/* Word Counter - Professional Styling */

:root {
    --primary-color: #2563eb;
    --success-color: #059669;
    --info-color: #0891b2;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --secondary-color: #6b7280;
    --background-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease;
}

/* Layout Structure */
.tool-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: auto;
    padding: 2rem 0 3rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tool-form {
    padding: 2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 200px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.option-card {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.option-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.speed-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speed-control label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--box-shadow);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--box-shadow);
}

.speed-control small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0e7490;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Result Section */
.result-section {
    margin-bottom: 2rem;
}

.result-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.stat-card.primary::before { background: var(--primary-color); }
.stat-card.success::before { background: var(--success-color); }
.stat-card.info::before { background: var(--info-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.danger::before { background: var(--danger-color); }
.stat-card.secondary::before { background: var(--secondary-color); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Detailed Section */
.detailed-section {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.detailed-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.analysis-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.metric-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* Word Frequency */
.word-frequency {
    margin-top: 2rem;
}

.word-frequency h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.frequency-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.frequency-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* History Section */
.history-section {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.history-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.history-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.history-item:hover {
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.history-preview {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.history-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Feature Grid */
.tool-features {
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem;
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: white;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-main {
        padding: 1rem 0;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .tool-form {
        padding: 1.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .detailed-section,
    .history-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

.stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 5px;
}

.textarea-container {
    position: relative;
}

.live-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.text-analysis {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 15px;
    margin-top: 20px;
}

.readability-score {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    margin: 5px;
}

.score-excellent { background-color: #28a745; }
.score-good { background-color: #17a2b8; }
.score-fair { background-color: #ffc107; color: #212529; }
.score-difficult { background-color: #fd7e14; }
.score-very-difficult { background-color: #dc3545; }

.keyword-list {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 15px;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.keyword-item:last-child {
    border-bottom: none;
}

.keyword-text {
    font-weight: 500;
}

.keyword-count {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.progress-container {
    margin: 15px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.875rem;
    color: #6c757d;
}

.word-density-chart {
    height: 300px;
    margin: 20px 0;
}

.history-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 15px;
    margin-bottom: 10px;
}

.history-meta {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.history-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.history-stat {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    color: #495057;
}

.export-options {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 20px;
    margin-top: 20px;
}

.format-option {
    margin: 10px 0;
}

.text-highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

.sentence-highlight {
    background: #d1ecf1;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 2px 0;
    display: inline-block;
}

.reading-time {
    background: linear-gradient(45deg, #007bff, #6c757d);
    color: white;
    padding: 15px;
    border-radius: 0.375rem;
    text-align: center;
    margin: 20px 0;
}

.reading-time h4 {
    margin: 0;
    font-size: 1.2rem;
}

.reading-time p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.comparison-table {
    margin-top: 20px;
}

.comparison-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.trend-indicator {
    display: inline-block;
    margin-left: 5px;
}

.trend-up { color: #28a745; }
.trend-down { color: #dc3545; }
.trend-stable { color: #6c757d; }

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tool-container {
        padding: 10px;
    }
    
    .history-stats {
        flex-direction: column;
        gap: 8px;
    }
}
