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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a2847 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 40px 20px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: white;
}

.header-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
    display: inline-block;
}

.status-indicator.running {
    background: var(--warning-color);
}

.status-indicator.error {
    background: var(--error-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.status-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Sections */
.section {
    margin-bottom: 50px;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.agent-card {
    border-left: 4px solid var(--primary-color);
}

.utility-card {
    border-left: 4px solid var(--secondary-color);
}

.scan-path-input {
    margin-bottom: 12px;
    width: 100%;
}

.date-range-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.date-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.date-input {
    margin-bottom: 0;
    color-scheme: dark;
}

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

.card-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    flex: 1;
}

.badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.utility-card .badge {
    background: var(--secondary-color);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #7c3aed 100%);
    color: white;
    width: 100%;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    width: auto;
}

.btn-small:hover {
    background: var(--primary-dark);
}

/* Output Section */
.output-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 50px;
}

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

.output-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

/* Progress Bar */
.progress-bar-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.output-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.output-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
}

.output-line {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    animation: slideIn 0.3s ease;
}

.output-line:last-child {
    border-bottom: none;
}

.output-line.error {
    color: var(--error-color);
}

.output-line.success {
    color: var(--success-color);
}

.output-line.warning {
    color: var(--warning-color);
}

.output-line.info {
    color: var(--primary-color);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 50px;
}

/* Scrollbar styling */
.output-container::-webkit-scrollbar {
    width: 8px;
}

.output-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.output-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.output-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Search Section */
.search-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 50px;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input,
.category-filter,
.scan-path-input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input,
.scan-path-input {
    flex: 1;
    min-width: 250px;
}

.search-input:focus,
.category-filter:focus,
.scan-path-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.category-filter {
    min-width: 150px;
}

/* Stats Container */
.stats-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-value-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.category-stats {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
}

.category-stats h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.category-name {
    color: var(--text-secondary);
}

.category-count {
    color: var(--primary-color);
    font-weight: 600;
}

/* Search Results */
.search-results {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.search-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
}

.file-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    word-break: break-all;
}

.file-meta {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.file-meta-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-path {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    word-break: break-all;
    font-family: 'Monaco', 'Courier New', monospace;
}

.file-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.duplicate-badge {
    display: inline-block;
    background: var(--warning-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

.classification-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

    .section h2 {
        font-size: 1.4rem;
    }

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

    .card-header {
        flex-direction: column;
        gap: 10px;
    }

    .badge {
        margin-left: 0;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-small {
        width: 100%;
    }

    .search-controls {
        flex-direction: column;
    }

    .search-input,
    .category-filter,
    .scan-path-input {
        width: 100%;
    }

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