/* EGaz Tekshiruvchi - Modern Dark Theme */

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --accent-primary: #00d4ff;
    --accent-secondary: #7b2cbf;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --success: #00e676;
    --danger: #ff5252;
    --warning: #ffab00;
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Input Section */
.input-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.input-section label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Consolas', monospace;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Filters Section */
.filters-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filters-section h3 {
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.filters-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toggle Switch */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.switch-label:hover {
    background: #1e2a4a;
    transform: translateX(4px);
}

.filter-switch {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #404060;
    border-radius: 13px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.filter-switch:checked+.switch-slider {
    background: var(--accent-primary);
}

.filter-switch:checked+.switch-slider::after {
    transform: translateX(24px);
}

.switch-text {
    flex: 1;
    font-size: 15px;
}

.switch-text small {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Check Button */
.check-button {
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
}

.check-button:active {
    transform: translateY(0);
}

.check-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-card.green .stat-value {
    color: var(--success);
}

.stat-card.red .stat-value {
    color: var(--danger);
}

.stat-card.orange .stat-value {
    color: var(--warning);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Results Section */
.results-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-header h3 {
    color: var(--accent-primary);
}

.results-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.results-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.results-list li {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Consolas', monospace;
    font-size: 15px;
}

.results-list li.category-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(123, 44, 191, 0.2) 100%);
    color: var(--accent-primary);
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    cursor: default;
    border-bottom: 2px solid var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-list li.category-header:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(123, 44, 191, 0.2) 100%);
}

.results-list li.result-item:hover {
    background: var(--bg-card);
}

.results-list li:last-child {
    border-bottom: none;
}

/* Scrollbar */
.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.results-list::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 4px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

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

    .results-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Progress Section */
.progress-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    color: var(--accent-primary);
    font-weight: 600;
}

.progress-count {
    color: var(--text-secondary);
    font-family: 'Consolas', monospace;
}

.progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-number {
    text-align: center;
    color: var(--text-secondary);
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

/* Collapsible Categories */
.category-container {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-container:last-child {
    border-bottom: none;
}

.category-container .category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(123, 44, 191, 0.15) 100%);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.category-container .category-header:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(123, 44, 191, 0.25) 100%);
}

.category-icon {
    color: var(--accent-primary);
    font-size: 12px;
    transition: transform 0.3s;
}

.category-container:not(.collapsed) .category-icon {
    transform: rotate(90deg);
}

.category-title {
    flex: 1;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-category-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
}

.copy-category-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.05);
}

.category-items {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-container:not(.collapsed) .category-items {
    max-height: 500px;
    overflow-y: auto;
}

.category-items li {
    padding: 12px 20px 12px 44px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'Consolas', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.category-items li:hover {
    background: var(--bg-card);
}

.category-items li:last-child {
    border-bottom: none;
}