/* CMS Edit Mode Toolbar Styles */

/* Toolbar Container */
.cms-edit-toolbar {
    height: 64px !important;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Toolbar Sections */
.cms-toolbar-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cms-toolbar-left {
    flex-shrink: 0;
}

.cms-toolbar-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.cms-toolbar-right {
    flex-shrink: 0;
    gap: 8px;
}

/* Toolbar Buttons */
.cms-toolbar-button {
    min-width: 44px;
    height: 40px;
    border-color: #0d5d2c !important;
    color: #0d5d2c !important;
    transition: all 0.2s ease;
}

.cms-toolbar-button:hover {
    background-color: #0d5d2c !important;
    color: white !important;
    border-color: #0d5d2c !important;
}

.cms-toolbar-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Save Button Emphasis */
.cms-toolbar-button:first-of-type {
    border-color: #f0b323 !important;
    color: #f0b323 !important;
    font-weight: 600;
}

.cms-toolbar-button:first-of-type:hover {
    background-color: #f0b323 !important;
    color: #0d5d2c !important;
    border-color: #f0b323 !important;
}

/* Saving State */
.cms-toolbar-button .mud-progress-circular {
    width: 20px !important;
    height: 20px !important;
}

/* Auto-save Indicator */
.cms-autosave-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-size: 0.875rem;
}

.cms-autosave-indicator svg {
    width: 16px;
    height: 16px;
}

/* Unsaved Changes Warning */
.cms-unsaved-warning {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Page Name Display */
.cms-page-name {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* Confirmation Dialog */
.cms-cancel-dialog {
    max-width: 500px;
}

.cms-cancel-dialog .mud-dialog-actions {
    gap: 8px;
    padding: 16px 24px;
}

/* Keyboard Shortcut Hints */
.cms-keyboard-hint {
    font-size: 0.75rem;
    color: #999;
    margin-left: 4px;
}

/* Responsive Behavior */
@media (max-width: 1279px) {
    .cms-toolbar-button span {
        display: none;
    }

    .cms-toolbar-button {
        min-width: 44px;
        padding: 8px;
    }

    .cms-toolbar-section {
        gap: 8px;
    }

    .cms-toolbar-center {
        display: none;
    }
}

@media (max-width: 959px) {
    .cms-edit-toolbar {
        height: 56px !important;
    }

    .cms-toolbar-section {
        gap: 4px;
    }

    .cms-toolbar-right {
        gap: 4px;
    }
}

/* Logo Animation */
.cms-toolbar-left svg {
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Stop rotation on hover */
.cms-toolbar-left:hover svg {
    animation-play-state: paused;
}

/* Success State */
.cms-save-success {
    color: #4caf50 !important;
}

.cms-save-success svg {
    animation: checkmark 0.5s ease-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error State */
.cms-save-error {
    color: #f44336 !important;
}

/* Loading Spinner Container */
.cms-loading-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cms-toolbar-left svg,
    .cms-unsaved-warning,
    .cms-save-success svg {
        animation: none !important;
    }

    .cms-toolbar-button {
        transition: none;
    }
}

/* Accessibility - High Contrast */
@media (prefers-contrast: high) {
    .cms-edit-toolbar {
        border-bottom-width: 3px;
    }

    .cms-toolbar-button {
        border-width: 2px !important;
    }
}

/* Focus States */
.cms-toolbar-button:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 599px) {
    .cms-toolbar-left {
        font-size: 0.9rem;
    }

    .cms-toolbar-button {
        min-width: 40px;
        height: 36px;
    }
}
