:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
    --error: #f85149;
    --success: #2ea043;
    --border-radius: 16px;
    --transition: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.header {
    text-align: center;
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.highlight {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 860px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Upload Section */
.upload-section h2, .results-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.instruction {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.upload-zone {
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: rgba(59, 130, 246, 0.03);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

#file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}

.drag-text {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.or-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.browse-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
}

.upload-zone:hover .browse-btn {
    background: var(--primary);
    color: white;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--panel-border);
    animation: fadeIn 0.3s ease;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.file-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

#file-name {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.remove-btn:hover {
    color: var(--error);
    background: rgba(248, 81, 73, 0.1);
}

/* Buttons */
.predict-btn {
    width: 100%;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.predict-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.predict-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #21262d;
    color: var(--text-secondary);
}

.spinner {
    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;
    position: absolute;
}

.predict-btn.loading .btn-text {
    opacity: 0;
}

.predict-btn.loading .spinner {
    display: block;
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
    min-height: 1.5em;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.badge {
    background: rgba(59, 130, 246, 0.15);
    color: #58a6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.table-container::-webkit-scrollbar {
    width: 8px;
}
.table-container::-webkit-scrollbar-track {
    background: transparent;
}
.table-container::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.3);
    border-radius: 4px;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
    padding: 2rem;
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.results-table th {
    background: rgba(22, 27, 34, 0.9);
    position: sticky;
    top: 0;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(4px);
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
}

.results-table tbody tr {
    transition: background 0.2s ease;
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.price-cell {
    font-weight: 600;
    color: #3fb950;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-cell::before {
    content: '$';
    color: var(--text-secondary);
    font-weight: 400;
}

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

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

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