* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f8b133;
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    border: 2px dashed #333;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #111;
}

.upload-area:hover {
    border-color: #f8b133;
    background: #1a1a1a;
}

.upload-area.dragover {
    border-color: #f8b133;
    background: #1a1a1a;
    transform: scale(1.02);
}

.upload-content svg {
    color: #f8b133;
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #f8b133;
}

.upload-content p {
    margin-bottom: 0.5rem;
}

.file-info {
    font-size: 0.9rem;
    opacity: 0.6;
}

.results-section {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.rules-panel, .testing-panel {
    background: #111;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #333;
}

.rules-panel h2, .testing-panel h2 {
    color: #f8b133;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.rules-count {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #222;
    border-radius: 6px;
    display: inline-block;
    font-size: 0.9rem;
}

.rules-list {
    background: #000;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #333;
}

.rule-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 6px;
    border-left: 3px solid #f8b133;
}

.rule-pattern {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #f8b133;
    margin-bottom: 0.25rem;
}

.rule-count {
    font-size: 0.85rem;
    opacity: 0.7;
}

.test-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.test-input input {
    flex: 1;
    padding: 0.75rem;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
}

.test-input input:focus {
    outline: none;
    border-color: #f8b133;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #f8b133;
    color: #000;
}

.btn-primary:hover {
    background: #e6a02e;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
}

.btn-accent {
    background: linear-gradient(135deg, #f8b133, #e6a02e);
    color: #000;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248, 177, 51, 0.3);
}

.test-results, .integrity-results {
    background: #000;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #333;
    min-height: 60px;
}

.test-result-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.test-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.test-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.test-warning {
    background: rgba(248, 177, 51, 0.1);
    border: 1px solid #f8b133;
    color: #f8b133;
}

.integrity-check {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: #f8b133;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #222;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.error-section {
    margin-bottom: 2rem;
    animation: slideUp 0.5s ease;
}

.error-panel {
    background: #1a0a0a;
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 1.5rem;
}

.error-panel h2 {
    color: #ef4444;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-summary {
    background: #2a1010;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #ef4444;
}

.error-tabs, .troubleshooting-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #999;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #f8b133;
    border-bottom-color: #f8b133;
}

.tab-btn:hover:not(.active) {
    color: #ccc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.error-list {
    max-height: 300px;
    overflow-y: auto;
}

.error-item {
    background: #1a1a1a;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #ef4444;
}

.warning-item {
    border-left-color: #f8b133;
}

.error-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.error-type {
    font-weight: 600;
    color: #ef4444;
    font-size: 0.85rem;
}

.warning-item .error-type {
    color: #f8b133;
}

.line-number {
    font-size: 0.8rem;
    opacity: 0.7;
}

.error-message {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.error-data {
    font-family: 'Courier New', monospace;
    background: #000;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #ccc;
    white-space: pre-wrap;
}

.error-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #222;
    border-radius: 6px;
}

.troubleshooting-section {
    margin-top: 2rem;
    border-top: 1px solid #333;
    padding-top: 1rem;
}

.troubleshooting-section h3 {
    color: #f8b133;
    margin-bottom: 1rem;
}

.troubleshooting-content {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
}

.unmapped-item, .conflict-item, .pattern-item {
    background: #1a1a1a;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid #f8b133;
}

.unmapped-url {
    font-family: 'Courier New', monospace;
    color: #f8b133;
    margin-bottom: 0.5rem;
}

.unmapped-reason {
    font-size: 0.9rem;
    opacity: 0.8;
}

.conflict-rules {
    margin-top: 0.5rem;
}

.conflict-rule {
    background: #2a1a1a;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.pattern-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: #1a1a1a;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8b133;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.error-badge {
    background: #ef4444;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.warning-badge {
    background: #f8b133;
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.export-section {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.export-select {
    flex: 1;
    padding: 0.75rem;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.export-select:focus {
    outline: none;
    border-color: #f8b133;
}

.export-select optgroup {
    background: #111;
    color: #f8b133;
}

.export-select option {
    background: #222;
    color: #fff;
    padding: 0.5rem;
}