/* Global Styles */
:root {
    /* Colors */
    --correct-color: #38a169;
    --incorrect-color: #e53e3e;
    --active-color: #f6e05e;
    --primary-color: #4299e1;
    --secondary-color: #718096;
    --header-bg: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    /* Dark gradient for header */
    --nav-bg: #2a4365;
    /* Darker shade for navigation */
    --footer-bg: #1a202c;
    --text-light: #ffffff;
    --text-muted: #a0aec0;
    --gradient-primary: linear-gradient(135deg, #4fd1c5, #805ad5);

    /* Typography */
    --font-family: 'Inter', sans-serif;
    --line-height: 1.7;

    /* Spacing */
    --padding-small: 0.6rem;
    --padding-medium: 1rem;
    --padding-large: 1.5rem;

    /* Shadows */
    --box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body {
    background-color: #edf2f7;
    min-height: 100vh;
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: #2d3748;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Header Styles */
.site-header {
    background: var(--header-bg);
    /* Gradient background */
    color: var(--text-light);
    padding: var(--padding-medium) var(--padding-large);
    /* Increased padding for better spacing */
    text-align: center;
    position: relative;
    box-shadow: var(--box-shadow);
}

/* Header container */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* Increased gap for better spacing */
    max-width: 800px;
    /* Reduced max width for a more compact layout */
    margin: 0 auto;
    flex-wrap: wrap;
}

/* Larger logo */
.site-logo {
    height: 50px;
    /* Increased logo size */
    flex-shrink: 0;
    transition: transform 0.3s ease;
    /* Smooth hover effect */
}

.site-logo:hover {
    transform: scale(1.1);
    /* Slight zoom on hover */
}

/* Title + tagline container */
.header-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.1;
    max-width: 200px;
    /* Increased max width for larger text */
}

.site-title {
    font-size: 2.5rem; /* Matches large logo feel */
    font-weight: 900;
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif; /* Modern rounded typeface */
    background: linear-gradient(to right, #1b4c7a 20%, #e84428 40%, #f9b200 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none; /* Removed shadow for clean look */
    transition: transform 0.3s ease;
    letter-spacing: -1px;
}

/* Hover effect */
.site-title:hover {
    transform: scale(1.05); /* Slight zoom */
    cursor: pointer;
}

}

/* Larger gradient tagline */
.site-tagline {
    font-size: 0.8rem;
    /* Increased font size */
    margin-top: 0.2rem;
    background: linear-gradient(90deg, #ff9966, #ff5e62);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400;
    opacity: 0.95;
    transition: opacity 0.3s ease;
    /* Smooth hover effect */
}

.site-tagline:hover {
    opacity: 1;
    /* Fully visible on hover */
}

/* Navigation Styles */
.main-nav {
    background: var(--nav-bg);
    padding: 0.5rem 0;
    /* Decreased padding to reduce height */
    margin-bottom: var(--padding-medium);
    text-align: center;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    /* Adjusted gap for better spacing */
    flex-wrap: wrap;
    max-width: 800px;
    /* Reduced max width for a more compact layout */
    margin: 0 auto;
}

.main-nav li {
    margin: 0 8px;
    /* Reduced margin */
}

.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    /* Reduced padding */
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        /* Adjusted width for better usability */
        height: 100vh;
        /* Full height for consistent behavior */
        background: var(--nav-bg);
        transition: right 0.3s ease;
        z-index: 1000;
        padding-top: 60px;
        /* Reduced padding to reduce height */
        align-items: flex-start;
        padding-left: 20px;
        overflow-y: auto;
        /* Add scroll if content overflows */
    }

    .main-nav ul.active {
        right: 0;
    }

    .main-nav li {
        margin: 12px 0;
        /* Reduced margin */
        width: 100%;
    }

    .main-nav a {
        color: var(--text-light);
        font-size: 0.9rem;
        /* Slightly smaller font size */
        display: block;
        padding: 8px 16px;
        /* Reduced padding */
        border-radius: 8px;
    }

    .main-nav a:hover {
        background: rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
}


/* Main Content Styles */
.container {
    flex: 1;
    padding: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

.site-description {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
    text-align: center;
}

/* Description Box */
.description-box {
    background: var(--gradient-primary);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0 50px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.description-content h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.description-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 25px;
}

.features span {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
}

.features i {
    margin-right: 8px;
}

/* Text Selection Styles */
.text-selection {
    text-align: center;
    padding: 30px;
    max-width: 900px;
    margin: 25px auto;
    background: linear-gradient(135deg, #fbc2eb, #fcd1d1);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.text-selection h2 {
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.dropdown-container {
    max-width: 900px;
    margin: 35px auto 0;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-label {
    font-weight: 600;
    margin-bottom: 14px;
    color: #2d3748;
    font-size: 1.2rem;
}

.form-select {
    border-radius: 10px;
    padding: 14px 22px;
    font-size: 1.2rem;
    border: 2px solid #cbd5e0;
    transition: all 0.3s ease;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(66, 153, 225, 0.25);
    outline: 0;
}

.form-select option {
    padding: 12px 18px;
    font-size: 1.1rem;
}

.form-select option[data-difficulty="easy"] {
    color: var(--correct-color);
}

.form-select option[data-difficulty="medium"] {
    color: #d69e2e;
}

.form-select option[data-difficulty="hard"] {
    color: var(--incorrect-color);
}

/* Typing Test Container */
.typing-test-container {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--box-shadow-lg);
    margin-bottom: 2rem;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.time-selection {
    flex: 1;
    min-width: 150px;
}

.time-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.time-dropdown {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--bg-light);
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.time-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.stats-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 2;
}

.stat-box {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
}

.reset-button {
    background: #f0f0f0;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.reset-button:hover {
    background: #e0e0e0;
}

.reset-button i {
    font-size: 0.9rem;
}

.progress-container {
    margin-bottom: 1rem;
}

.line-counter {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.text-display {
    font-size: 1rem;                  /* Slightly smaller than before */
    line-height: 1.7;
    padding: 1.2rem;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 1.2rem;
    min-height: 140px;

    font-family: Arial, Helvetica, sans-serif;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    letter-spacing: normal;
}

.text-line {
    margin-bottom: 0.6rem;
    display: none;
}

.text-line:first-child,
.text-line:nth-child(2) {
    display: block;
}

.char {
    white-space: pre-wrap;
    position: relative;
    transition: all 0.2s;
    font-size: 1.3rem;
}

.char.correct {
    color: var(--correct-color);
}

.char.incorrect {
    color: var(--incorrect-color);
    text-decoration: underline;
}

.char.active {
    background-color: var(--active-color);
    border-radius: 4px;
    animation: pulse 1s infinite;
}

.input-container {
    margin-top: 1rem;
}

.typing-input {
    font-size: 1.2rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    resize: none;
    height: 140px;
    width: 100%;
    transition: all 0.3s;
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}
/* Test Results Styles */
.test-results-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #343a40;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.result-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.result-value {
    font-weight: 500;
    color: #212529;
    margin-right: 30px;
}

.typed-text-review {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.6;
}

.typed-text-review .correct {
    color: #28a745;
}

.typed-text-review .incorrect {
    color: #dc3545;
    text-decoration: underline;
}

#try-again-btn {
    padding: 10px 30px;
    font-weight: 600;
}

/* Animated Heading */
.animated-heading {
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    animation: glow 2s infinite alternate, bounce 1s infinite;
}

/* Quick Test Section */
.quick-tests {
    text-align: center;
    margin: 25px;
}

.quick-tests-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.quick-test-link img {
    width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s;
}

.quick-test-link:hover img {
    transform: translateY(-8px);
}

/* Footer Styles */
.site-footer {
    background: var(--footer-bg);
    color: var(--text-light);
    padding: 2rem 0;
    margin-top: 2.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.75;
}

.copyright {
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.copyright a {
    color: var(--text-light);
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

/* Button Styles */
.btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:hover {
    background: #2b6cb0;
    border-color: #2c5282;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    border-color: #3e4c5a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

@keyframes glow {
    0% {
        color: #4299e1;
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    }

    50% {
        color: #4fd1c5;
        text-shadow: 4px 4px 10px rgba(66, 153, 225, 0.5);
    }

    100% {
        color: #4299e1;
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .site-title {
        font-size: 2rem;
    }

    .description-content h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .site-logo {
        margin-right: 0;
        margin-bottom: 18px;
    }

    .description-box {
        padding: 25px;
    }

    .features {
        flex-direction: column;
        gap: 12px;
    }

    #text-container {
        font-size: 1.2rem;
    }

    .char {
        font-size: 1.2rem;
    }

    .circular-progress {
        width: 100px;
        height: 100px;
    }

    .circular-progress .value {
        font-size: 1.5rem;
    }

    .dropdown-container {
        padding: 18px;
        margin: 22px auto;
    }

    .form-select {
        font-size: 1.1rem;
        padding: 12px 18px;
    }

    .form-label {
        font-size: 1.1rem;
    }
}

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

    .site-title {
        font-size: 1.7rem;
    }

    .description-content h3 {
        font-size: 1.5rem;
    }

    #stats {
        flex-direction: column;
        gap: 0.6rem;
    }

    #stats .badge {
        width: 100%;
        text-align: center;
    }

    .circular-progress {
        width: 80px;
        height: 80px;
    }

    .circular-progress .value {
        font-size: 1.3rem;
    }

    #results .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .quick-test-link img {
        width: 100%;
        max-width: 300px;
    }
}