/**
 * Admin Bar Styles
 * Professional admin control bar with Waterford Chamber branding
 */

.admin-bar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-bottom: 3px solid #3EA2BE;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 9999;
    transition: all 0.3s ease;
}

.admin-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3EA2BE 0%, #8DB63F 50%, #3EA2BE 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.admin-bar .container {
    padding-top: 0;
    padding-bottom: 0;
}

.admin-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.875rem 0;
    min-height: 60px;
}

.admin-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.938rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    background: rgba(62, 162, 190, 0.15);
    border-radius: 6px;
    border-left: 3px solid #3EA2BE;
    white-space: nowrap;
}

.admin-label i {
    color: #3EA2BE;
    font-size: 1.125rem;
}

.admin-buttons {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.admin-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.admin-btn i {
    font-size: 0.938rem;
    opacity: 0.9;
}

/* Primary button variant */
.admin-btn-primary {
    background: linear-gradient(135deg, #3EA2BE 0%, #2d8ba3 100%);
    border-color: #3EA2BE;
    box-shadow: 0 2px 8px rgba(62, 162, 190, 0.3);
}

.admin-btn-primary:hover {
    background: linear-gradient(135deg, #2d8ba3 0%, #3EA2BE 100%);
    border-color: #4db3cc;
    box-shadow: 0 4px 12px rgba(62, 162, 190, 0.4);
}

/* Edit toggle - active state */
#editToggle.active {
    background: linear-gradient(135deg, #8DB63F 0%, #7aa335 100%);
    border-color: #8DB63F;
    box-shadow: 0 2px 8px rgba(141, 182, 63, 0.3);
}

#editToggle.active:hover {
    background: linear-gradient(135deg, #7aa335 0%, #8DB63F 100%);
    border-color: #9dc94d;
    box-shadow: 0 4px 12px rgba(141, 182, 63, 0.4);
}

/* Logout button - distinct styling */
.admin-btn[href="/logout"] {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.admin-btn[href="/logout"]:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .admin-controls {
        gap: 1rem;
    }
    
    .admin-buttons {
        gap: 0.5rem;
    }
    
    .admin-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.813rem;
    }
    
    .admin-label {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 0;
    }
    
    .admin-label {
        justify-content: center;
    }
    
    .admin-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .admin-bar::before {
        height: 2px;
    }
    
    .admin-label span:not(.fa-user-cog) {
        display: none;
    }
    
    .admin-label::after {
        content: 'Admin';
        font-size: 0.75rem;
    }
    
    .admin-btn span {
        display: none;
    }
    
    .admin-btn i {
        font-size: 1.125rem;
        margin: 0;
    }
}

/* Animation for when admin bar appears */
.admin-bar {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Adjust main header when admin bar is present */
body.admin-logged-in .main-header {
    top: 60px;
}

/* Add visual feedback for edit mode */
body.edit-mode-active {
    border-top: 3px solid #8DB63F;
}

body.edit-mode-active [data-admin-editable] {
    outline: 2px dashed rgba(141, 182, 63, 0.5);
    outline-offset: 2px;
    cursor: pointer;
    transition: outline-color 0.2s ease;
}

body.edit-mode-active [data-admin-editable]:hover {
    outline-color: #8DB63F;
    background: rgba(141, 182, 63, 0.05);
}

/* Loading state for save button */
.admin-btn.saving {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.admin-btn.saving::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Success state */
.admin-btn.saved {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
}

.admin-btn.saved i::before {
    content: '\f00c'; /* fa-check */
}

/* Badge for unsaved changes */
.admin-btn[data-unsaved-changes]::before {
    content: attr(data-unsaved-changes);
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.688rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
    min-width: 18px;
    text-align: center;
}

/* Dark mode adjustments (if you implement dark mode) */
@media (prefers-color-scheme: dark) {
    .admin-bar {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-bottom-color: #3EA2BE;
    }
}

/* Print styles */
@media print {
    .admin-bar {
        display: none !important;
    }
}