:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #45a29e;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --correct-color: #4CAF50;
    --incorrect-color: #f44336;
    --warning-color: #ff9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #303231;
}

header {
    /* background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); */
    background-color: #301338;
    color: white;
    padding: 20px 0;
    text-align: center;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}


/* Header styles: background, text color, padding, and layout */

.header {
    background-color: #901f1f;
    /* Dark red background */
    color: #fff;
    /* White text */
    padding: 25px 10px;
    /* Padding around header */
    display: flex;
    justify-content: center;
    /* border: #000000 4px solid; /* Black border around header */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth 
  text-align: center;  */
}


/* Container for header content: aligns logo and text */

.header-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    text-align: center;
}


/* Logo image size */

.header-logo img {
    height: 80px;
    width: auto;
    border-radius: 38px;
    /* Slightly rounded corners */
    box-shadow: 12px 12px 12px rgba(0, 0, 0, 0.2);
    /* Subtle shadow */
    image-resolution: from-image;
    /* Ensure high-res images look sharp */
    transition: transform 0.3s ease;
    /* Smooth hover effect */
    border: #ffffff 2px solid;
    /* Black border around logo */
}


/* Main header text size */

.header-text h1 {
    margin: 0;
    font-size: 2.5em;
}


/* Header tagline style */


/* Navigation bar styles: background,
layout,
and shadow */

.navbar {
    background-color: #000000;
    /* display: flex; */
    /* justify-content: space-between; */
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1000;
}


/* Wrapper for menu and nav links */

.menu-wrapper {
    position: relative;
}


/* Navigation links layout */

.nav-links {
    display: flex;
}


/* Navigation link styles */

.navbar a {
    padding: 14px 15px;
    color: white;
    text-decoration: none;
}


/* Navigation link hover effect */

.navbar a:hover {
    background-color: #1fbdec;
}


/* Hamburger menu button for mobile */

.hamburger {
    display: none;
    background: none;
    border: 0;
    font-size: 26px;
    color: white;
    cursor: pointer;
}


/* Search bar container */

.search-container {
    position: relative;
}


/* Search input styling */

#searchInput {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    outline: none;
}


/* Suggestions dropdown styling */

#suggestions {
    position: absolute;
    top: 35px;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    width: 200px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}


/* Individual suggestion style */

#suggestions div {
    padding: 8px;
    cursor: pointer;
}


/* Suggestion hover effect */

#suggestions div:hover {
    background: #f1f1f1;
}


/* Responsive navigation for mobile screens */

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #333;
        width: 130px;
        flex-direction: column;
        padding: 8px 0;
        border-radius: 8px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    }
    .nav-links a {
        display: block;
        padding: 10px 14px;
        text-align: left;
    }
    /* Show nav links on hover or focus */
    .menu-wrapper:hover .nav-links,
    .menu-wrapper:focus-within .nav-links {
        display: flex;
    }
}

.header-text p {
    margin: 5px 0 0;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    margin-top: 20px;
    /* max-width: 1000px; */
}

.sidebar {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-buttons {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-color);
    transition: all 0.3s;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.lesson-list {
    list-style-type: none;
}

.lesson-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: var(--light-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-item:hover {
    background-color: #e9ecef;
}

.lesson-item.active {
    background-color: var(--primary-color);
    color: white;
}

.lesson-progress {
    font-size: 0.8rem;
    opacity: 0.7;
}

.typing-area {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.typing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 10px 15px;
    background-color: var(--light-color);
    border-radius: 5px;
    min-width: 100px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-color);
}

.text-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.8;
    height: 200px;
    /* fixed display height so multiple lines can appear and we can scroll */
    min-height: 150px;
    overflow-y: auto;
    /* allow vertical scrolling */
    scroll-behavior: smooth;
    /* smooth scroll when moving to next line */
    white-space: normal;
    /* allow wrapping inside lines if needed */
}

.current-char {
    background-color: var(--warning-color);
    color: white;
    padding: 0 2px;
    border-radius: 3px;
}

.correct {
    color: var(--correct-color);
}

.incorrect {
    color: var(--incorrect-color);
    text-decoration: underline;
}

.typing-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.typing-input:focus {
    border-color: var(--primary-color);
}

.keyboard-display {
    margin-top: 30px;
    background-color: #082746;
    padding: 20px;
    border-radius: 8px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    width: 50px;
    height: 50px;
    margin: 0 4px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.1s;
}

.key.active {
    background-color: var(--warning-color);
    color: white;
    transform: translateY(2px);
}

.key.space {
    width: 300px;
}

.key.special {
    width: 130px;
    background-color: #e9ecef;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.progress-container {
    margin-top: 30px;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--correct-color);
    width: 0%;
    transition: width 0.3s;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #6c757d;
}

footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .key {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    .key.space {
        width: 150px;
    }
    .stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    .stat-box {
        min-width: 80px;
        padding: 8px 10px;
    }
}


/* Each displayed lesson line */

.typing-line {
    margin-bottom: 8px;
}

.typing-line.active {
    /* visually emphasize the active line */
    background: rgba(21, 76, 139, 0.04);
    padding: 6px 8px;
    border-radius: 6px;
}

.typing-line.completed span.correct {
    opacity: 0.7;
}

.text-display span.current-char {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15) inset;
}

.text-display span {
    display: inline-block;
    padding: 2px 1px;
    transition: background-color 0.1s;
}

.text-display span.correct {
    background-color: #d4edda;
    color: #155724;
}

.text-display span.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    text-decoration: underline;
}

.lesson-item.completed {
    color: #28a745;
    font-weight: bold;
}