/* ===== MAIN CONTAINER CSS ===== */
/* All main element and .container related styles */

/* === COMMON CONTAINER === */
/* MODIFIED: This is the core of the responsive viewport solution */
.container {
    background:
        radial-gradient(circle at 20% 80%, rgba(139, 90, 92, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(107, 138, 170, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(122, 132, 113, 0.02) 0%, transparent 70%),
        rgba(230, 250, 230, 0.6);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    
    /* Desktop container dimensions - flexible height for scaling */
    width: clamp(320px, 98vw, 1600px); /* Responsive width with min/max */
    min-height: clamp(500px, 95vh, 1200px); /* Minimum height */
    height: auto; /* Allow natural height expansion */
    
    /* MODIFIED: Use flexbox to manage internal layout and allow scrolling */
    display: flex;
    flex-direction: column; /* Stack header and choices vertically */
    
    overflow-y: auto; /* Allow vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal overflow */
    
    /* Centering */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    z-index: 10; /* Ensure container is above background elements but below menus */
    border: 1px solid rgba(198, 40, 40, 0.3);
    box-sizing: border-box; /* Ensure padding and border are included in dimensions */
    
    /* MODIFIED: Use clamp for responsive padding - reduced for better space utilization */
    padding: clamp(0.3rem, 0.8vh, 0.8rem) clamp(0.5rem, 1vh, 1rem) clamp(0.8rem, 1.2vh, 1.2rem);
}

/* Mobile Container Styles */
@media (max-width: 480px) {
    .container {
        /* Keep same dimensions as setup page - no height changes */
        padding: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: clamp(0.3rem, 1.5vw, 0.8rem) !important;
    }
}

@media (min-width: 1025px) {
    .container {
        width: clamp(320px, 98vw, 1600px);
        min-height: clamp(500px, 98vh, 1200px);
        height: clamp(500px, 98vh, 1200px);
        max-height: clamp(500px, 98vh, 1200px);
    }
}

@media (max-height: 650px) {
    .container {
        padding: 0.5rem;
        min-height: clamp(400px, 95vh, 650px);
        height: auto;
    }
}

@media (max-height: 600px) {
    .container {
        padding: 0.3rem;
        min-height: clamp(400px, 95vh, 600px);
        height: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.25rem;
    }
}

/* Dark mode container styles */
body.dark-mode .container { 
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.2) 0%, rgba(25, 30, 40, 0.18) 30%, rgba(30, 35, 45, 0.16) 70%, rgba(35, 40, 50, 0.15) 100%) !important; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important; 
    border: 1px solid rgba(255, 255, 255, 0.12) !important; 
    -webkit-backdrop-filter: blur(20px) !important; 
    backdrop-filter: blur(20px) !important; 
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) !important; 
    will-change: background, box-shadow; 
}

/* Mobile Container Styles */
@media (max-width: 768px) {
    /* Modern Mobile Container - Scrollable Design */
    main.container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        min-height: 100vh;
        height: auto !important;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow-y: auto;

        /* Match desktop background */
        background:
            radial-gradient(circle at 20% 80%, rgba(139, 90, 92, 0.03) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(107, 138, 170, 0.03) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(122, 132, 113, 0.02) 0%, transparent 70%),
            rgba(230, 250, 230, 0.6);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        border-radius: 25px;
    }

    main {
        overflow: visible !important; /* Allow badges to extend beyond main */
        height: auto !important; /* Natural height */
        min-height: 100vh !important; /* Minimum viewport height */
        max-height: none !important; /* Remove height constraints */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        position: relative !important;
    }

    main.container,
    .container,
    body main.container,
    main {
        background: transparent !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* Desktop main element styling */
@media (min-width: 769px) {
    main {
        width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin: 0;
        padding: 0;
        overflow-y: auto; /* Allow scrolling */
        overflow-x: hidden;
        position: relative;
    }
}

/* Ensure proper main element styling */
main {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    overflow-y: auto; /* Allow scrolling */
    overflow-x: hidden;
    position: relative;
}

/* Desktop-specific main element adjustments */
@media (min-width: 1025px) {
    main {
        flex: 1;
    }
}
