/* Universal Mobile Header Styles */

/* Override base header with universal styles */
.mobile-header {
    background: linear-gradient(135deg, var(--ds-primary, #0F4C81), var(--ds-primary-dark, #0A3659));
    color: white;
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px var(--shadow-color);
    height: var(--header-height);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
}

/* Universal header content area */
.universal-header-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 8px;
}

/* Header actions container */
.universal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Universal button base styles */
.universal-back-button,
.universal-menu-button,
.universal-theme-toggle,
.universal-action-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.universal-back-button:hover,
.universal-menu-button:hover,
.universal-theme-toggle:hover,
.universal-action-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.universal-back-button:active,
.universal-menu-button:active,
.universal-theme-toggle:active,
.universal-action-button:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

/* Specific button styles */
.universal-back-button {
    font-size: 1rem;
}

.universal-menu-button {
    font-size: 1.2rem;
}

.universal-theme-toggle {
    font-size: 1rem;
}

.universal-action-button {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.15);
}

.universal-action-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Header logo and title */
.header-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.header-logo-img {
    height: 28px;
    margin-right: 8px;
    object-fit: contain;
    transition: all var(--transition-speed);
}

.invert-logo {
    filter: brightness(0) invert(1);
}

.mobile-header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    transition: all var(--transition-speed);
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 375px) {
    .mobile-header {
        padding: 12px 12px;
    }
    
    .universal-back-button,
    .universal-menu-button,
    .universal-theme-toggle,
    .universal-action-button {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .universal-menu-button {
        font-size: 1.1rem;
    }
    
    .mobile-header h1 {
        font-size: 1.1rem;
    }
    
    .header-logo-img {
        height: 24px;
        margin-right: 6px;
    }
    
    .universal-header-actions {
        gap: 6px;
    }
}

@media (max-width: 320px) {
    .mobile-header h1 {
        font-size: 1rem;
    }
    
    .header-logo-img {
        height: 22px;
        margin-right: 4px;
    }
    
    .universal-back-button,
    .universal-menu-button,
    .universal-theme-toggle,
    .universal-action-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Animation for button state changes */
.universal-back-button,
.universal-menu-button,
.universal-theme-toggle,
.universal-action-button {
    animation-duration: 0.3s;
    animation-timing-function: ease-out;
}

@keyframes buttonShow {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes buttonHide {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Theme icon transitions */
.theme-light-icon,
.theme-dark-icon {
    transition: all 0.3s ease;
}

/* Ripple effect for touch feedback */
.universal-back-button::after,
.universal-menu-button::after,
.universal-theme-toggle::after,
.universal-action-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.universal-back-button:active::after,
.universal-menu-button:active::after,
.universal-theme-toggle:active::after,
.universal-action-button:active::after {
    width: 80px;
    height: 80px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-header {
        border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .universal-back-button,
    .universal-menu-button,
    .universal-theme-toggle,
    .universal-action-button {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .universal-back-button,
    .universal-menu-button,
    .universal-theme-toggle,
    .universal-action-button,
    .header-logo,
    .header-logo-img,
    .mobile-header h1 {
        transition: none;
    }
    
    .universal-back-button::after,
    .universal-menu-button::after,
    .universal-theme-toggle::after,
    .universal-action-button::after {
        display: none;
    }
}


/* Accessibility improvements */
.universal-back-button:focus,
.universal-menu-button:focus,
.universal-theme-toggle:focus,
.universal-action-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Content positioning is handled by main mobile.css */