/* ==========================================================================
   Device Select Page Styles
   Shared CSS for all 5 device select pages (full, reading, speaking, listening, writing)
   ========================================================================== */

/* Page Layout */
.device-select-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.device-select-page main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-top: 0; Removed to allow standard header spacing */
}

/* Hero Section */
.device-select-hero {
    width: 100%;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #0b2241 0%, #008CBC 100%);
    color: var(--white);
}

.device-select-hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 120px;
    line-height: 1.2;
}

/* Device Options Container */
.device-options {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* Individual Device Card */
.device-card {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 30px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    /* Transparent glassy background */
    backdrop-filter: blur(10px);
    /* Glassmorphism blur */
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Subtle border for definition */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    /* Improved shadow */
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    /* Start hidden for animation */
}

/* Stagger animation for second card */
.device-card:nth-child(2) {
    animation-delay: 0.2s;
}

.device-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.device-card:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 4px;
}

/* Device Mockup Image */
.device-card-image {
    width: 100%;
    max-width: 250px;
    height: auto;
    margin-bottom: 25px;
    object-fit: contain;
}

/* Device Card Button/Label */
.device-card-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid var(--white);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    /* Aligns button to bottom of card */
}

.device-card:hover .device-card-label {
    background-color: var(--white);
    color: var(--primary-blue);
    /*transform: translateY(-2px);*/
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Recommended Badge */
.recommended-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #FFD200 0%, #F7971E 100%);
    /* Vibrant Gold/Orange Gradient */
    color: #484b08;
    /* Dark Blue text for premium contrast */
    font-size: 11.6px;
    font-weight: 800;
    /* Extra bold */
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(247, 151, 30, 0.5);
    /* Matching warm shadow */
    z-index: 2;
}

/* Thumbs Up Icon */
.device-select-icon {
    width: 46px;
    height: 46px;
    position: absolute;
    top: -24px;
    right: -24px;
    z-index: 3;
    transform: rotate(8deg);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .device-select-hero {
        padding: 40px 20px;
    }

    .device-select-hero h1 {
        font-size: 24px;
        margin-bottom: 50px;
    }

    .device-options {
        /* flex-direction: column;  REMOVED to keep row layout */
        flex-direction: row;
        gap: 15px;
        /* Reduced gap from 30px */
        padding: 0 10px;
    }

    .device-card {
        min-width: 0;
        /* Allow shrinking below content size */
        flex: 1;
        /* Split available space evenly */
        max-width: none;
        padding: 15px;
        /* Reduce padding to fit content */
    }

    .device-card-image {
        max-width: 180px;
        margin-top: 30px;
    }

    .device-card-label {
        padding: 14px 30px;
        font-size: 16px;
    }

    .recommended-badge {
        top: -10px;
        right: 15px;
        font-size: 10px;
        padding: 5px 12px;
    }

    .device-select-icon {
        width: 40px;
        height: 40px;
        top: -20px;
        right: -24px;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible improvements */
.device-card:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 4px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .device-card {
        transition: none;
    }

    .device-card:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .device-card {
        border: 2px solid var(--dark-grey);
    }

    .device-card-label {
        border: 2px solid var(--white);
    }
}

@media (max-width: 480px) {
    .device-select-hero {
        padding: 40px 5px;
    }

    .device-options {
        gap: 8px;
        padding: 0;
    }

    .device-card {
        padding: 10px;
        min-width: 0;
    }

    .device-card-image {
        max-width: 120px;
        margin-bottom: 15px;
    }

    .device-card-label {
        padding: 10px 15px;
        font-size: 13px;
        border-width: 1px;
    }

    .recommended-badge {
        font-size: 9px;
        padding: 4px 10px;
        right: 10px;
    }

    .device-select-icon {
        width: 30px;
        height: 30px;
        top: -15px;
        right: -15px;
    }
}