* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100%;
}

/* Sidebar */
#sidebar {
    width: 320px;
    min-width: 320px;
    background: #1a1a2e;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid #2d2d44;
}

.site-logo {
    display: block;
    margin-bottom: 16px;
}

.site-logo img {
    height: 24px;
}

h1 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 4px;
}

.subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #4a4a6a;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin-bottom: 20px;
}

.drop-zone:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.drop-zone.drag-over {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.drop-zone-content svg {
    color: #10b981;
    margin-bottom: 12px;
}

.drop-zone-content p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.drop-zone-content strong {
    color: #10b981;
}

.drop-zone .hint {
    font-size: 0.75rem;
    color: #666;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Info Panels */
.info-panel {
    background: #252540;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-panel h3 {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 12px;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-item {
    text-align: center;
    padding: 8px 4px;
    background: #1a1a2e;
    border-radius: 6px;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.stat-item .stat-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.stat-item.error .stat-value {
    color: #ef4444;
}

.stat-item.warning .stat-value {
    color: #f59e0b;
}

.stat-item.info .stat-value {
    color: #3b82f6;
}

.file-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    padding-top: 8px;
    border-top: 1px solid #2d2d44;
}

/* Filter Controls */
.filter-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-btn {
    flex: 1;
    padding: 8px 4px;
    background: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 6px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #10b981;
    color: #10b981;
}

.filter-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: #000;
}

.filter-btn[data-filter="error"].active {
    background: #ef4444;
    border-color: #ef4444;
}

.filter-btn[data-filter="warning"].active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.filter-btn[data-filter="info"].active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.search-box {
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    background: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.search-box input::placeholder {
    color: #666;
}

.search-box input:focus {
    outline: none;
    border-color: #10b981;
}

/* Export Controls */
#export-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #3d3d5c;
    color: #ccc;
}

.btn-secondary:hover {
    background: #4d4d6c;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Credits */
.credits {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #2d2d44;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

.credits a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.credits a:hover {
    color: #10b981;
}

.credits .author {
    color: #10b981;
    font-weight: 500;
}

/* Main Area */
#main-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0; /* Required for flex children to scroll */
    display: flex;
    flex-direction: column;
}

/* Empty State */
#empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

#empty-state svg {
    color: #4a4a6a;
    margin-bottom: 20px;
}

#empty-state h2 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 8px;
}

#empty-state p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 24px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #888;
}

.feature-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    background: #252540;
    color: #10b981;
}

.feature-icon.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.feature-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.feature-icon.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Progress Overlay */
#progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.progress-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #2d2d44;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#progress-text {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #2d2d44;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.1s;
    width: 0%;
}

#progress-count {
    font-size: 0.85rem;
    color: #888;
    display: block;
    margin-bottom: 20px;
}

/* Results Panel */
#results-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #2d2d44;
    flex-shrink: 0;
}

.results-header h2 {
    font-size: 1rem;
    color: #fff;
}

#results-count {
    font-size: 0.85rem;
    color: #888;
}

/* Issues Container */
.issues-container {
    flex: 1 1 0;
    height: 0; /* Force flex to control height */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #3d3d5c;
}

.issue-item.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.issue-item.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.issue-item.info {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.issue-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.issue-item.error .issue-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.issue-item.warning .issue-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.issue-item.info .issue-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.issue-content {
    flex: 1;
    min-width: 0;
}

.issue-file {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
    word-break: break-all;
}

.issue-message {
    display: block;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

.issue-type {
    font-size: 0.65rem;
    color: #666;
    background: #252540;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #3d3d5c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d6c;
}

/* Responsive */
@media (max-width: 900px) {
    #app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    #sidebar {
        width: 100%;
        min-width: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #2d2d44;
    }

    #main-area {
        min-height: 50vh;
    }

    body {
        overflow: auto;
    }
}

@media (max-width: 640px) {
    #sidebar {
        padding: 16px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .file-breakdown {
        flex-wrap: wrap;
        gap: 8px;
    }

    .drop-zone {
        padding: 20px 16px;
    }
}
