/* style.css - Typing Test Tool Styles with Difficulty & Social Share */

.typing-test-container {
    padding: 2rem 0 4rem;
    background: var(--bg);
    min-height: 70vh;
}

.typing-test-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.typing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.typing-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.typing-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Difficulty Selector */
.difficulty-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.difficulty-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    text-align: center;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.difficulty-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text);
}

.difficulty-btn i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.difficulty-btn span {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.difficulty-btn small {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
}

.difficulty-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    background: var(--surface);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    color: white;
}

.difficulty-btn.active i,
.difficulty-btn.active small {
    color: white;
}

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Fira Code', monospace;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 600;
}

/* Test Card */
.test-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
    position: relative;
}

.sample-text {
    background: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

#textToType span {
    transition: all 0.05s linear;
}

.sample-text .correct {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.15);
    border-radius: 3px;
}

.sample-text .incorrect {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.2);
    text-decoration: underline;
    text-decoration-color: #ef4444;
    border-radius: 3px;
}

.sample-text .current {
    background: var(--primary);
    color: white;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--primary);
    padding: 0 2px;
}

.user-input {
    width: 100%;
    height: 180px;
    padding: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.2s;
}

.user-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.user-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.8rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-light);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Result Modal */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.result-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 550px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.result-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.result-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.result-stats {
    background: var(--bg);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.result-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 1rem;
}

.result-stat:last-child {
    border-bottom: none;
}

.result-stat strong {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Social Share Card */
.social-share-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 20px;
    padding: 1.2rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--border);
}

.share-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.share-title i {
    color: var(--primary);
    font-size: 1.2rem;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.share-btn {
    padding: 0.6rem 0.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.share-btn i {
    font-size: 1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.share-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

.share-btn.facebook:hover {
    background: #4267B2;
    color: white;
    border-color: #4267B2;
}

.share-btn.linkedin:hover {
    background: #0077B5;
    color: white;
    border-color: #0077B5;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.share-btn.copy:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.share-message {
    margin-top: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.share-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.share-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Info Section */
.typing-info {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.typing-info h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.typing-info p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .typing-title {
        font-size: 2rem;
    }
    
    .difficulty-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .test-card {
        padding: 1.2rem;
    }
    
    .sample-text {
        font-size: 0.9rem;
        padding: 1rem;
    }
    
    .user-input {
        height: 150px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
    }
    
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
    
    .stats-dashboard {
        grid-template-columns: 1fr 1fr;
    }
    
    .test-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
}

.light-mode .sample-text {
    background: rgba(99, 102, 241, 0.05);
}

.light-mode .user-input {
    background: #f9fafb;
}