:root{--primary:#6366f1;--primary-dark:#4f46e5;--border:#e5e7eb;--surface:#ffffff;--shadow-soft:0 2px 8px rgba(0,0,0,0.08);--surface-muted:#f9fafb;--text-main:#1f2937;--text-muted:#6b7280;}
/* Frequency Tool Container */
.frequency-tool {
    margin-top: 2rem;
}

.tool-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Input Section */
.input-section {
    padding: 2rem;
}

.input-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.label-text {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
}

.label-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    
    resize: vertical;
    transition: all 0.2s ease;
    background: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
}

.input-field:focus {
    outline: none;
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.control-select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1.125rem;
}

/* Results Section */
.results-section {
    border-top: 2px solid #e5e7eb;
    padding: 2rem;
    background: #fafafa;
}

.results-header {
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

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

.stat-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Frequency Container */
.frequency-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.frequency-header {
    display: grid;
    grid-template-columns: 100px 1fr 80px 100px;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frequency-rows {
    max-height: 500px;
    overflow-y: auto;
}

.frequency-row {
    display: grid;
    grid-template-columns: 100px 1fr 80px 100px;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    transition: background 0.2s ease;
}

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

.frequency-row:hover {
    background: #f9fafb;
}

.freq-col-number {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9375rem;
}

.freq-col-bar {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.frequency-bar {
    height: 24px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    min-width: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.freq-col-count {
    font-weight: 600;
    color: #6366f1;
    text-align: right;
    font-size: 0.9375rem;
}

.freq-col-percent {
    color: #6b7280;
    text-align: right;
    font-size: 0.875rem;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-export {
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    
}

.btn-export:hover {
    background: #f9fafb;
    border-color: #6366f1;
    color: #6366f1;
}

.btn-export span:first-child {
    font-size: 1rem;
}

/* Empty State */
.frequency-empty {
    padding: 3rem 1.25rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .input-section,
    .results-section {
        padding: 1.5rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .frequency-header,
    .frequency-row {
        grid-template-columns: 80px 1fr 60px 70px;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .freq-col-number,
    .freq-col-count {
        font-size: 0.875rem;
    }

    .freq-col-percent {
        font-size: 0.8125rem;
    }

    .frequency-bar {
        height: 20px;
    }

    .action-buttons,
    .export-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary,
    .btn-export {
        width: 100%;
        justify-content: center;
    }

    .results-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .input-section,
    .results-section {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .frequency-header,
    .frequency-row {
        grid-template-columns: 60px 1fr 50px 60px;
        gap: 0.5rem;
        padding: 0.75rem;
        font-size: 0.8125rem;
    }

    .frequency-header {
        font-size: 0.75rem;
    }
}

/* Scrollbar Styling */
.frequency-rows::-webkit-scrollbar {
    width: 8px;
}

.frequency-rows::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.frequency-rows::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.frequency-rows::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
