/* ========================================
   TYPING TEST SYSTEM - MAIN STYLESHEET
   ======================================== */

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo h1 {
    color: #667eea;
    font-size: 1.8rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #667eea;
}

/* MAIN CONTENT */
main {
    padding: 3rem 0;
}

.welcome-section {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* TEST CONTAINER */
.test-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 3rem;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.test-header h3 {
    color: #667eea;
    font-size: 1.8rem;
}

.test-info {
    display: flex;
    gap: 2rem;
}

.test-info span {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer strong,
.difficulty strong {
    font-size: 1.5rem;
    color: #667eea;
}

/* TEXT DISPLAY */
.text-display {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    font-size: 1.3rem;
    line-height: 2;
    margin-bottom: 2rem;
    border: 2px solid #e0e0e0;
    min-height: 150px;
    letter-spacing: 0.5px;
}

.text-display .correct {
    color: #28a745;
    background: #d4edda;
}

.text-display .wrong {
    color: #dc3545;
    background: #f8d7da;
}

.text-display .current {
    background: #fff3cd;
    border-bottom: 2px solid #667eea;
}

/* TYPING AREA */
.typing-area {
    margin-bottom: 2rem;
}

#typingInput {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.2rem;
    border: 2px solid #667eea;
    border-radius: 10px;
    resize: none;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

#typingInput:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#typingInput:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

/* CONTROLS */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* STATS DISPLAY */
.stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

/* RESULT SECTION */
.result-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.result-section h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
}

.result-item h4 {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.result-big {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.result-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.result-details p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.login-prompt {
    text-align: center;
    margin-top: 2rem;
    font-size: 1.1rem;
}

.login-prompt a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}

/* FEATURES SECTION */
.features {
    background: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.features h3 {
    text-align: center;
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    background: #f8f9fa;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* FOOTER */
footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* LOGIN FORMS */
.login-container,
.dashboard-container {
    max-width: 500px;
    margin: 3rem auto;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-container h2,
.dashboard-container h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* DASHBOARD */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.dashboard-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-nav .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.test-list {
    display: grid;
    gap: 1rem;
}

.test-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s;
}

.test-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.test-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.test-meta {
    display: flex;
    gap: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-free {
    background: #28a745;
    color: white;
}

.badge-normal {
    background: #ffc107;
    color: #333;
}

.badge-hard {
    background: #dc3545;
    color: white;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

table tr:hover {
    background: #f8f9fa;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .test-header {
        flex-direction: column;
        gap: 1rem;
    }

    .stats {
        flex-direction: column;
    }

    .result-card {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }
}