/* Base Styles - Common styles used across all pages */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    /* Prevent bounce scrolling on iOS */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(rgba(240, 240, 235, 0.75), rgba(235, 235, 230, 0.7)), 
                url('../images/v996-008.jpg') center/cover no-repeat fixed;
    background-attachment: fixed;
    line-height: 1.6;
    color: #444;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    height: 100%;
    overflow-x: hidden;
    /* Prevent white areas during scroll */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    /* Safe area support for phones with notches */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    /* Fix for iOS keyboard issues */
    -webkit-text-size-adjust: 100%;
}

/* Mobile-specific background fix */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* Fixed attachment can cause issues on mobile */
        min-height: 100vh;
        min-height: 100dvh;
        position: relative;
        /* Prevent zoom-related white spaces */
        touch-action: pan-x pan-y;
        overflow-x: hidden;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(rgba(240, 240, 235, 0.75), rgba(235, 235, 230, 0.7)), 
                    url('../images/v996-008.jpg') center/cover no-repeat;
        background-size: cover;
        background-position: center;
        z-index: -1;
        /* Extend beyond viewport to prevent white areas during zoom/scroll */
        width: 200%;
        height: 200%;
        left: -50%;
        top: -50%;
        /* Prevent scaling issues during zoom */
        will-change: transform;
        transform: scale(1.1);
    }
    
    /* Additional zoom protection */
    * {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Allow text selection only in input fields */
    input, textarea {
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    /* Additional padding for mobile safe areas */
    padding-left: max(20px, env(safe-area-inset-left) + 10px);
    padding-right: max(20px, env(safe-area-inset-right) + 10px);
}

/* Alert Styles */
.alert {
    padding: 20px 28px;
    margin: 16px 0;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
                0 8px 20px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
}

.alert-info {
    background: linear-gradient(145deg, #fff9c4, #fef3cd);
    border-color: #f59e0b;
    color: #92400e;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15),
                0 8px 20px rgba(0, 0, 0, 0.06),
                0 0 8px rgba(245, 158, 11, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.alert-info::before {
    content: "ℹ️";
    font-size: 1.2rem;
    margin-right: 12px;
    opacity: 0.8;
}

.alert-warning {
    background: linear-gradient(145deg, #fff3cd, #fef3cd);
    border-color: #f59e0b;
    color: #92400e;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15),
                0 8px 20px rgba(0, 0, 0, 0.06),
                0 0 8px rgba(245, 158, 11, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.alert a {
    color: #92400e;
    font-weight: bold;
    text-decoration: underline;
}

.alert-success {
    background: linear-gradient(145deg, #d1fae5, #dcfce7);
    border: 2px solid #10b981;
    color: #065f46;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15),
                0 8px 20px rgba(0, 0, 0, 0.06),
                0 0 8px rgba(16, 185, 129, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.alert-error {
    background: linear-gradient(145deg, #fee2e2, #fecaca);
    border: 2px solid #ef4444;
    color: #991b1b;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15),
                0 8px 20px rgba(0, 0, 0, 0.06),
                0 0 8px rgba(239, 68, 68, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Mobile Base Styles */
@media (max-width: 480px) {
    .container {
        padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left) + 6px);
        padding-right: max(12px, env(safe-area-inset-right) + 6px);
    }
    
    .alert {
        padding: 16px 20px;
        margin: 12px 0;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    
    .alert-info::before {
        font-size: 1rem;
        margin-right: 8px;
    }
    
    /* Ensure touch targets are at least 44px */
    button, .btn, a[role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve text readability on mobile */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Global GDPR Badge Styling */
.gdpr-badge,
.consent-text .gdpr-badge,
.privacy-footer .gdpr-badge,
span.gdpr-badge {
    display: inline-block !important;
    background: #28a745 !important;
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin-left: 8px !important;
    vertical-align: middle !important;
    border: none !important;
    text-decoration: none !important;
}

/* Mobile-specific GDPR badge adjustments */
@media (max-width: 768px) {
    .gdpr-badge,
    .consent-text .gdpr-badge,
    .privacy-footer .gdpr-badge,
    span.gdpr-badge {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
        border-radius: 12px !important;
        text-align: center !important;
        width: fit-content !important;
    }
}
