:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    
    --success: #10b981; /* Green */
    --warning: #f59e0b; /* Yellow */
    --critical: #ef4444; /* Red */
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-main: 'Inter', sans-serif;
}

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

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

/* Background Animations */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Typography & General */
.highlight {
    color: var(--primary);
    background: -webkit-linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Index Page */
.container.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-text {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.search-panel {
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.6s ease-out;
}

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

.input-group {
    margin-bottom: 2rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.mode-selection {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-card {
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    transition: all 0.3s ease;
}

.radio-label input:checked + .radio-card {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.radio-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.radio-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.primary-btn {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4);
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.error-msg {
    margin-top: 1rem;
    color: var(--critical);
    text-align: center;
    font-size: 0.9rem;
}

/* Report Page Layout */
.report-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.sidebar .logo-text {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.nav-links {
    list-style: none;
    margin-bottom: 3rem;
}

.nav-links li {
    margin-bottom: 1rem;
}

.nav-btn {
    display: block;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
}

.nav-btn.action {
    background: var(--primary);
    font-weight: 600;
}

.nav-btn.action:hover {
    background: var(--primary-hover);
}

.next-steps-panel {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 8px;
    flex-grow: 1;
}

.next-steps-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--accent);
}

.checklist {
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.main-dashboard {
    flex-grow: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--primary);
}

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

.stat-card {
    padding: 1.5rem;
    text-align: center;
}

.stat-card h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
}

.error-text { color: var(--critical); }

.reports-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.report-card {
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    color: #000;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    word-break: break-all;
}

.card-body {
    padding: 1.5rem;
}

.data-section {
    margin-bottom: 2rem;
}

.data-section h4 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: normal;
    color: var(--accent);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.3rem;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.data-item {
    background: rgba(255,255,255,0.02);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--glass-border);
    position: relative;
    display: flex;
    align-items: center;
}

.data-item .label {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
    width: 150px;
    font-weight: normal;
}

.data-item .value {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: normal;
    flex-grow: 1;
}

.status-indicator {
    position: static;
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: normal;
    text-transform: uppercase;
}

/* Status Colors */
.status-optimized { border-left-color: var(--success); }
.status-optimized .status-indicator { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.status-warning { border-left-color: var(--warning); }
.status-warning .status-indicator { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.status-duplicate,
.status-critical-error { border-left-color: var(--critical); }
.status-duplicate .status-indicator,
.status-critical-error .status-indicator { background: rgba(239, 68, 68, 0.2); color: var(--critical); }

.keywords .keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kw-tag {
    background: rgba(255,255,255,0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.kw-tag .count {
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

/* Image Details Table */
.image-details-list {
    margin-top: 1.5rem;
    overflow-x: auto;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
}

.styled-table th, .styled-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.styled-table th {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.styled-table tr:last-of-type td {
    border-bottom: none;
}

.styled-table tr.missing-alt td:first-child::after {
    content: " (No Alt)";
    color: var(--critical);
    font-size: 0.75rem;
    margin-left: 5px;
    font-weight: bold;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
