/* Word Counter Tool Styles */

.word-counter {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.input-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.input-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-clear {
    background-color: #dc3545;
    color: white;
}

.btn-clear:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

#textInput {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#textInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#textInput::placeholder {
    color: #999;
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.stats-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Analysis Section */
.analysis-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.reading-time,
.word-frequency {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.reading-time h4,
.word-frequency h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.reading-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reading-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.reading-value {
    font-weight: bold;
    color: #007bff;
}

.reading-label {
    color: #666;
    font-size: 0.9rem;
}

.frequency-list {
    max-height: 200px;
    overflow-y: auto;
}

.frequency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.frequency-item:last-child {
    border-bottom: none;
}

.frequency-word {
    font-weight: 500;
    color: #333;
}

.frequency-count {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.no-data {
    color: #999;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
}

/* Additional Stats */
.additional-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.additional-stats h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2rem;
}

.additional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.additional-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.additional-label {
    color: #666;
    font-weight: 500;
}

.additional-value {
    color: #007bff;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .word-counter {
        padding: 15px;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .input-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .analysis-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .additional-grid {
        grid-template-columns: 1fr;
    }
    
    .additional-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}