/**
 * Essential App Theme Variables & Styles
 * Extracted from header.php inline CSS for better performance
 */

/* ==========================================================================
   CSS Variables - App Theme
   ========================================================================== */

:root {
    /* Brand Colors - Enhanced Blue Theme */
    --primary: #00A7E1;
    --primary-dark: #0086b3;
    --primary-light: #e6f7fd;
    --primary-gradient: linear-gradient(135deg, #00A7E1 0%, #0086b3 100%);
    --primary-gradient-light: linear-gradient(135deg, #e6f7fd 0%, #cceeff 100%);
    --secondary: #003B5C;
    
    /* Text Colors */
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    
    /* UI Colors */
    --border-color: #eeeeee;
    --background: #f8f9fa;
    --danger: #ff3b30;
    --success: #34c759;
    
    /* Blue Theme Accents */
    --blue-accent: rgba(0, 167, 225, 0.1);
    --blue-hover: rgba(0, 167, 225, 0.05);
    --blue-active: rgba(0, 167, 225, 0.15);
}

/* ==========================================================================
   WebView Compatibility - Gradient Fallbacks
   ========================================================================== */

/* WebView gradient fallbacks */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .address-bar {
        background: #00A7E1 !important;
    }
    
    .btn-primary,
    .primary-button {
        background: #00A7E1 !important;
    }
    
    .mobile-nav {
        background: white !important;
    }
    
    .progress-blue {
        background: #e6f7fd !important;
    }
    
    .progress-blue .progress-bar {
        background: #00A7E1 !important;
    }
    
    .badge-blue {
        background: #00A7E1 !important;
    }
}

/* ==========================================================================
   Address Bar Styles - Clean Mobile
   ========================================================================== */

.address-bar {
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 52px;
    border-bottom: 2px solid transparent;
}

.address-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.address-bar:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 134, 179, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.address-bar:hover::after {
    left: 100%;
}

.address-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.location-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.location-icon i {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: white;
}

.address-bar:hover .location-icon {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.address-bar:hover .location-icon i {
    transform: scale(1.1);
    color: white;
}

.address-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    justify-content: center;
}

.address-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: color 0.3s ease;
}

.address-text {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    color: white;
    text-shadow: none;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.address-bar:hover .address-label {
    color: white;
}

.address-bar:hover .address-text {
    color: white;
    transform: translateX(2px);
}

.address-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.address-arrow i {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: white;
}

.address-bar:hover .address-arrow {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.2);
}

.address-bar:hover .address-arrow i {
    transform: rotate(180deg);
    color: white;
}

/* ==========================================================================
   Search Container Styles
   ========================================================================== */

.search-container {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 48px;
    width: auto;
    contain: strict;
}

.search-wrapper {
    flex: 1;
    max-width: 400px;
}

.search-bar {
    background-color: var(--background);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.search-bar:active {
    transform: scale(0.98);
}

.search-bar i {
    color: var(--text-light);
    margin-right: 10px;
}

.search-input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ==========================================================================
   Flash Messages - Safe Area Compatible
   ========================================================================== */

.flash-container {
    padding: 15px 20px;
    /* Safe area support for devices with notches */
    padding-top: calc(15px + var(--safe-area-inset-top));
    padding-left: calc(20px + var(--safe-area-inset-left));
    padding-right: calc(20px + var(--safe-area-inset-right));
    position: relative;
    z-index: 1000;
    /* Prevent status bar overlap */
    margin-top: var(--safe-area-inset-top);
}

.flash-alert {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px 20px;
    margin-bottom: 12px;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: slideInDown 0.3s ease-out;
    border: 1px solid transparent;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-alert.success {
    background: linear-gradient(135deg, var(--success) 0%, #28a745 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.flash-alert.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc3545 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.flash-alert.warning {
    background: linear-gradient(135deg, #ffcc00 0%, #ffc107 100%);
    color: #212529;
    border-color: rgba(0, 0, 0, 0.1);
}

.flash-alert.info {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    color: inherit;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* WebView optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .flash-alert.success {
        background: #34c759 !important;
    }
    
    .flash-alert.danger {
        background: #ff3b30 !important;
    }
    
    .flash-alert.warning {
        background: #ffcc00 !important;
    }
    
    .flash-alert.info {
        background: #00A7E1 !important;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .flash-container {
        padding: 12px 16px;
        padding-top: calc(12px + var(--safe-area-inset-top));
        padding-left: calc(16px + var(--safe-area-inset-left));
        padding-right: calc(16px + var(--safe-area-inset-right));
    }
    
    .flash-alert {
        padding: 14px 18px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .alert-close {
        top: 10px;
        right: 10px;
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Blue Theme Navigation & Interactive Elements
   ========================================================================== */

/* Mobile navigation with blue accents */
.mobile-nav {
    background: linear-gradient(to bottom, white 0%, #fafbfc 100%);
    border-top: 1px solid var(--primary-light);
}

/* Active navigation states */
.mobile-nav .nav-item.active {
    color: var(--primary);
    background: var(--blue-hover);
    border-radius: 8px;
}

.mobile-nav .nav-item:hover {
    background: var(--blue-hover);
    border-radius: 8px;
}

/* Search bar blue theme */
.search-bar {
    border: 1px solid transparent;
}

.search-bar:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--blue-accent);
}

/* Button blue theme enhancements */
.btn-primary,
.primary-button {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 167, 225, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 167, 225, 0.4);
}

/* Blue accent elements */
.accent-blue {
    background: var(--blue-accent);
    border-left: 3px solid var(--primary);
}

.badge-blue {
    background: var(--primary-gradient);
    color: white;
}

/* Progress indicators */
.progress-blue {
    background: var(--primary-gradient-light);
}

.progress-blue .progress-bar {
    background: var(--primary-gradient);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 390px) {
    .address-label {
        font-size: 0.7rem;
        letter-spacing: 0.6px;
    }
    
    .address-text {
        font-size: 0.9rem;
        letter-spacing: 0.2px;
    }
    
    .location-icon {
        width: 32px;
        height: 32px;
    }
    
    .location-icon i {
        font-size: 14px;
    }
    
    .address-arrow {
        width: 26px;
        height: 26px;
    }
    
    .address-arrow i {
        font-size: 11px;
    }
}

@media (min-width: 430px) {
    .address-label {
        font-size: 0.8rem;
        letter-spacing: 0.9px;
    }
    
    .address-text {
        font-size: 1rem;
        letter-spacing: 0.4px;
    }
    
    .location-icon {
        width: 38px;
        height: 38px;
    }
    
    .location-icon i {
        font-size: 17px;
    }
    
    .address-arrow {
        width: 30px;
        height: 30px;
    }
    
    .address-arrow i {
        font-size: 13px;
    }
}