:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Mesh */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    filter: blur(40px);
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Glass Container */
.glass-container {
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin: 40px 0;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

h1 {
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-weight: 300;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.drop-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.icon-container {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.drop-zone:hover .icon-container {
    transform: scale(1.1);
}

.drop-zone h3 {
    margin-bottom: 8px;
    font-weight: 500;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn.text-only {
    background: none;
    color: var(--text-muted);
}

.btn.text-only:hover {
    color: var(--text-main);
}

/* Queue, Summary & Result Sections */
.queue-section, .ai-summary-section, .result-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

.hidden {
    display: none !important;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 8px;
}
.section-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

#queue-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.file-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}
.file-icon {
    font-size: 24px;
    color: var(--text-muted);
}
.file-info {
    flex: 1;
    min-width: 0;
}
.file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.file-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.status-pending { color: var(--text-muted); }
.status-uploading { color: var(--primary-color); animation: spin 1s linear infinite; }
.status-success { color: var(--success); }
.status-error { color: var(--error); }

/* AI Summary Section */
.ai-summary-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

.summary-container {
    background: rgba(99, 102, 241, 0.1); /* A subtle purple background */
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 24px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
}

/* Results */
.result-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.result-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.result-content {
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.drop-zone .size-limit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 16px;
    margin-bottom: 0;
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    padding: 30px; /* Overriding glass-container padding */
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 12px;
}

.modal-content p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

#confirmation-file-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 24px;
}

#confirmation-file-list .file-item.invalid .file-name,
#confirmation-file-list .file-item.invalid .file-meta {
    color: var(--error);
    text-decoration: line-through;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}
