/**
 * Word Counter & Read Time Calculator - Stylesheet
 */

.word-counter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.word-counter-header {
    margin-bottom: 40px;
}

.word-counter-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.word-counter-header h1 i {
    color: #3498db;
    font-size: 2.2rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: #3498db;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    color: white;
    font-size: 1.8rem;
}

.read-aloud .stat-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.reading .stat-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.words .stat-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.characters .stat-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stat-content h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-time {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 5px 0;
    font-family: 'Courier New', monospace;
}

.stat-wpm {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

.stat-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 5px 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.word-counter-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

@media (max-width: 992px) {
    .word-counter-body {
        grid-template-columns: 1fr;
    }
}

.input-section textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 250px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8f9fa;
}

.input-section textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: white;
}

.input-section textarea.focused {
    border-color: #3498db;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.controls-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.control-group {
    margin-bottom: 30px;
}

.control-group label {
    display: block;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label i {
    color: #3498db;
    font-size: 1.2rem;
}

.control-group label span {
    color: #e74c3c;
    font-weight: 700;
    margin-left: 5px;
}

.slider-container {
    position: relative;
    padding: 10px 0 30px 0;
}

.wpm-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #3498db, #2ecc71);
    border-radius: 4px;
    outline: none;
    transition: opacity 0.2s;
}

.wpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2c3e50;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.wpm-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2c3e50;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.wpm-slider.active::-webkit-slider-thumb {
    transform: scale(1.2);
    background: #e74c3c;
}

.wpm-slider.active::-moz-range-thumb {
    transform: scale(1.2);
    background: #e74c3c;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-note {
    background: #e3f2fd;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 4px;
    margin-top: 30px;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-note i {
    color: #3498db;
    font-size: 1.1rem;
    margin-top: 2px;
}

.word-counter-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .word-counter-container {
        padding: 20px;
    }
    
    .word-counter-header h1 {
        font-size: 2rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .controls-section {
        padding: 20px;
    }
}

/* Loading State */
.loading {
    position: relative;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility */
.wpm-slider:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.btn:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .word-counter-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .button-group,
    .info-note,
    .word-counter-footer {
        display: none;
    }
}