/* ========================================
   SVG Validator - InMapper Light Theme
   ======================================== */

:root {
    /* InMapper Brand Colors */
    --orange-primary: #F58634;
    --orange-light: #FF9F5A;
    --orange-dark: #E07020;
    --orange-glow: rgba(245, 134, 52, 0.2);
    --orange-bg: rgba(245, 134, 52, 0.08);
    
    --gray-dark: #5A5A5A;
    --gray-medium: #7A7A7A;
    --gray-light: #9A9A9A;
    
    /* Light Theme Colors */
    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-hover: #F0F2F5;
    
    --text-primary: #2D3748;
    --text-secondary: #5A6577;
    --text-muted: #8A95A5;
    
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    
    --border: #E2E8F0;
    --border-light: #EDF2F7;
    
    /* Typography */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-orange: 0 4px 20px rgba(245, 134, 52, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Subtle Background Pattern */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(245, 134, 52, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: -2;
}

.bg-glow {
    position: fixed;
    top: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        circle,
        rgba(245, 134, 52, 0.06) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-dark);
}

.logo-title span {
    color: var(--orange-primary);
}

.logo-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.4rem 0.85rem;
    background: var(--orange-bg);
    border: 1px solid rgba(245, 134, 52, 0.2);
    border-radius: var(--radius-sm);
    color: var(--orange-primary);
    font-weight: 500;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-zone:hover {
    border-color: var(--orange-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.upload-zone:hover::before {
    opacity: 0.03;
}

.upload-zone.drag-over {
    border-color: var(--orange-primary);
    background: var(--orange-bg);
}

.upload-zone.drag-over::before {
    opacity: 0.06;
}

.upload-icon {
    color: var(--orange-primary);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.upload-icon svg {
    filter: drop-shadow(0 4px 12px var(--orange-glow));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.upload-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.upload-formats {
    position: relative;
    z-index: 1;
}

.format-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    background: var(--orange-bg);
    border: 1px solid rgba(245, 134, 52, 0.2);
    border-radius: var(--radius-sm);
    color: var(--orange-primary);
}

/* Loading Section */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--orange-primary);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.loader-ring:nth-child(2) {
    inset: 8px;
    border-top-color: var(--orange-light);
    animation-delay: -0.3s;
}

.loader-ring:nth-child(3) {
    inset: 16px;
    border-top-color: var(--orange-dark);
    animation-delay: -0.15s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* File Info Bar */
.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.file-icon {
    color: var(--orange-primary);
}

.file-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
}

.btn-new {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-new:hover {
    border-color: var(--orange-primary);
    color: var(--orange-primary);
    background: var(--orange-bg);
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.status-banner.success {
    background: var(--success-bg);
    border: 1px solid var(--success);
}

.status-banner.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
}

.status-banner.error {
    background: var(--error-bg);
    border: 1px solid var(--error);
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.status-banner.success .status-icon {
    background: var(--success);
    color: white;
}

.status-banner.success .status-icon::before {
    content: '✓';
}

.status-banner.warning .status-icon {
    background: var(--warning);
    color: white;
}

.status-banner.warning .status-icon::before {
    content: '!';
}

.status-banner.error .status-icon {
    background: var(--error);
    color: white;
}

.status-banner.error .status-icon::before {
    content: '✕';
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-title svg {
    color: var(--orange-primary);
}

/* Statistics Grid */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: var(--orange-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--orange-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

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

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

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

.stat-card.default .stat-value {
    color: var(--gray-dark);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Layers Section */
.layers-section {
    margin-bottom: 2rem;
}

.layers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.layer-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.layer-badge:hover {
    border-color: var(--orange-primary);
    color: var(--orange-primary);
    background: var(--orange-bg);
}

/* Warnings & Errors Sections */
.warnings-section,
.errors-section {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.section-header:hover {
    background: var(--bg-hover);
}

.section-header .section-title {
    margin: 0;
}

.warning-title svg {
    color: var(--warning) !important;
}

.error-title svg {
    color: var(--error) !important;
}

.count-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    background: var(--warning);
    color: white;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.count-badge.error {
    background: var(--error);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: all var(--transition-fast);
}

.toggle-btn:hover {
    color: var(--orange-primary);
}

.toggle-btn.collapsed svg {
    transform: rotate(-90deg);
}

.warnings-content,
.errors-content {
    border-top: 1px solid var(--border);
    max-height: 500px;
    overflow-y: auto;
    transition: max-height var(--transition-base);
}

.warnings-content.collapsed,
.errors-content.collapsed {
    max-height: 0;
    border-top: none;
}

.warnings-list,
.errors-list {
    padding: 0.5rem;
}

.warning-item,
.error-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--warning);
}

.error-item {
    border-left-color: var(--error);
}

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.item-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-weight: 500;
}

.error-item .item-code {
    background: var(--error-bg);
    color: var(--error);
}

.item-element {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.item-message {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.item-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.detail-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
    align-items: baseline;
}

.detail-key {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-val {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.detail-subrow {
    margin-left: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.detail-subrow code,
.detail-row code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--orange-primary);
    word-break: break-all;
}

/* Details Section */
.details-section {
    margin-bottom: 2rem;
}

.details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 180px;
    flex-shrink: 0;
    font-weight: 500;
}

.detail-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-word;
}

.detail-value.list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.detail-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--orange-bg);
    border: 1px solid rgba(245, 134, 52, 0.2);
    border-radius: var(--radius-sm);
    color: var(--orange-primary);
}

/* Export Section */
.export-section {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-orange);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(245, 134, 52, 0.35);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--orange-primary);
    text-decoration: none;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upload-zone {
        padding: 2.5rem 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-label {
        min-width: auto;
    }
}
