:root {
    /* Light Theme (Default) */
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #6366f1; /* Indigo matching some tones in Fionics logo */
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --dropzone-bg: rgba(99, 102, 241, 0.03);
    --dropzone-border: #c7d2fe;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --success-color: #34d399;
    --success-bg: rgba(16, 185, 129, 0.1);
    --dropzone-bg: rgba(129, 140, 248, 0.05);
    --dropzone-border: #475569;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

#theme-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

#theme-btn:hover {
    background: var(--surface-hover);
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    flex-grow: 1;
}

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

.logo {
    max-width: 180px;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Dropzone */
.dropzone-container {
    margin-bottom: 2rem;
}

.dropzone {
    border: 2px dashed var(--dropzone-border);
    border-radius: 16px;
    background-color: var(--dropzone-bg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.drag-active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.upload-icon {
    color: var(--primary-color);
    opacity: 0.8;
}

.dropzone-text {
    font-weight: 500;
    font-size: 1.125rem;
}

.dropzone-sub {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Progress */
.progress-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, opacity 0.3s;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.progress-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 4px;
}

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

/* Result Section */
.result-section {
    margin-bottom: 3rem;
}

.result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.4s ease-out forwards;
}

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

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

.success-icon {
    color: var(--success-color);
}

.result-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.result-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Gallery */
.recent-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

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

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

.pdf-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
}

.item-details {
    overflow: hidden;
}

.item-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}
