/* 
   kumon-level-test.study - Premium CSS Design System
   Aesthetics: Clean Academic, Modern, Mobile-First
*/

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1100px;
}

/* Reset and Core Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-title);
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Section */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.logo-icon {
    background-color: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.3);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-body);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: rgba(30, 64, 175, 0.05);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0d9488 100%);
    color: white;
    padding: 4.5rem 0;
    text-align: center;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    color: white;
    font-size: 2.75rem;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Main Layout Cards */
.intro-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.level-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(30, 64, 175, 0.2);
}

.level-badge {
    background-color: var(--primary);
    color: white;
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.level-badge.level-o {
    background-color: var(--accent);
}

.level-card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.level-card-body ul {
    list-style: none;
    margin: 1.5rem 0;
}

.level-card-body li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-card-body li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
}

.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    text-align: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

.btn.btn-accent {
    background-color: var(--accent);
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.btn.btn-accent:hover {
    background-color: #0f766e;
}

/* Image Showcase Layout */
.showcase-section {
    margin-bottom: 4rem;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.image-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.image-card:hover {
    box-shadow: var(--shadow-md);
}

.image-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background-color: #eaeaea;
    aspect-ratio: 3 / 4;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.image-wrapper:hover img {
    transform: scale(1.03);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: var(--transition);
}

.image-wrapper:hover .image-overlay {
    opacity: 1;
}

.image-caption {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.image-caption h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

/* Horizontal Tabs Layout (for Level O Questions) */
.tabs-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 4rem;
}

.tabs-nav-wrapper {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background-color: #f1f5f9;
}

.tabs-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    padding: 0.5rem;
    gap: 0.5rem;
}

.tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background-color: rgba(15, 23, 42, 0.05);
}

.tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.tab-content {
    padding: 2.5rem;
    min-height: 450px;
}

.tab-panel {
    display: none;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .tab-panel {
        grid-template-columns: 1.2fr 1fr;
    }
}

.tab-panel.active {
    display: grid;
}

.panel-image-section {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4 / 3;
}

.panel-image-section img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f8fafc;
}

.panel-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.panel-info h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.qa-card {
    background-color: #f8fafc;
    border-left: 4px solid var(--accent);
    padding: 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1.5rem;
}

.qa-title {
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 0.5rem;
}

.educational-content {
    background-color: #eff6ff;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px dashed rgba(30, 64, 175, 0.2);
}

/* Lightbox Modal (for viewing large worksheets) */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Footer styling */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 1px solid #1e293b;
    text-align: center;
}

.site-footer p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #cbd5e1;
    font-weight: 500;
}

.footer-link:hover {
    color: white;
}

/* Mobile Responsiveness Rules */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .intro-card {
        padding: 1.5rem;
    }
    
    .tabs-content {
        padding: 1.5rem;
    }
    
    .tab-panel {
        gap: 1.5rem;
    }
    
    .panel-image-section {
        aspect-ratio: 4 / 3;
    }
    
    .site-nav {
        display: none; /* Hide top nav links on small screens */
    }
}
