/* css/style.css
   Custom CSS for TypeMaster KH Landing Page (Light Mode) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Kantumruy+Pro:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;       /* Indigo */
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #06B6D4;     /* Cyan */
    --accent: #F43F5E;        /* Rose */
    
    --bg-main: #FAFAFC;
    --bg-card: #FFFFFF;
    
    --text-primary: #1E293B;  /* Slate 800 */
    --text-muted: #64748B;    /* Slate 500 */
    --text-light: #F8FAFC;    /* Slate 50 */
    
    --border-color: #E2E8F0;  /* Slate 200 */
    
    --font-en: 'Inter', sans-serif;
    --font-kh: 'Kantumruy Pro', 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(79, 70, 229, 0.05), 0 4px 6px -2px rgba(79, 70, 229, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    --border-radius: 16px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-en);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Khmer content font override */
.lang-km {
    font-family: var(--font-kh);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-kh);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

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

/* Main Container Grid & Structure */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Gradient text utility */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header & Nav */
header {
    background-color: rgba(250, 250, 252, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    padding: 80px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.download-badges {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-radius: 12px;
    background-color: #1E293B;
    color: white;
    font-size: 0.85rem;
    border: 1px solid #334155;
}

.download-btn:hover {
    background-color: #0F172A;
    transform: translateY(-2px);
}

.download-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.download-btn .btn-text span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #94A3B8;
}

.download-btn .btn-text strong {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Hero Mockup Widget */
.hero-mockup {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-preview-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

/* Interactive Typing Widget CSS */
.widget-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.widget-title h3 {
    font-size: 1.2rem;
}

.lang-selector {
    display: flex;
    background-color: #F1F5F9;
    padding: 4px;
    border-radius: 8px;
}

.lang-tab {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.lang-tab.active {
    background-color: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.typing-area {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-height: 120px;
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 16px;
    position: relative;
    user-select: none;
    max-height: 160px;
    overflow-y: auto;
}

.text-to-type {
    color: var(--text-muted);
}

.char-correct {
    color: #10B981; /* Green */
    background-color: rgba(16, 185, 129, 0.1);
}

.char-incorrect {
    color: var(--accent); /* Red */
    background-color: rgba(244, 63, 94, 0.1);
    text-decoration: underline;
}

.char-current {
    border-bottom: 2px solid var(--primary);
    animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
    50% { border-color: transparent; }
}

.typing-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

.typing-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.typing-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stat-box {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Features grid */
.features-section {
    padding: 80px 0;
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 54px auto;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Leaderboard section */
.leaderboard-section {
    padding: 80px 0;
}

.leaderboard-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.leaderboard-tabs {
    display: flex;
    background-color: #F1F5F9;
    padding: 4px;
    border-radius: 8px;
}

.leaderboard-tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
}

.leaderboard-tab.active {
    background-color: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.leaderboard-table-container {
    overflow-x: auto;
}

table.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.leaderboard-table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
    font-size: 0.9rem;
}

table.leaderboard-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

table.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-1 { background-color: #FEF3C7; color: #D97706; } /* Gold */
.rank-2 { background-color: #E2E8F0; color: #475569; } /* Silver */
.rank-3 { background-color: #FFEDD5; color: #C2410C; } /* Bronze */
.rank-other { background-color: #F1F5F9; color: var(--text-muted); }

/* Footer */
footer {
    background-color: #1E293B;
    color: #94A3B8;
    padding: 60px 0 30px 0;
    border-top: 1px solid #334155;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.footer-column h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #334155;
    font-size: 0.85rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .download-badges {
        justify-content: center;
    }
    
    .hero-mockup {
        margin-top: 32px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
