:root {
    --bg-base: #0a0a0e;
    --bg-glass: rgba(22, 23, 31, 0.45);
    --bg-glass-hover: rgba(32, 34, 46, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);

    --accent-primary: #6d28d9;
    --accent-glow: rgba(109, 40, 217, 0.4);
    --accent-secondary: #0ea5e9;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --idle: #475569;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blooms */
.bloom {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.bloom-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.bloom-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.bloom-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #db2777 0%, transparent 70%);
    top: 30%;
    left: 40%;
    opacity: 0.2;
    animation-direction: alternate-reverse;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Glassmorphism Classes */
.glass-header,
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

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

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.auth-config {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.auth-config i {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-config input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    width: 150px;
}

.auth-config input::placeholder {
    color: var(--text-muted);
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

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

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

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.panel-header i {
    color: var(--accent-secondary);
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Upload Panel */
.upload-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.dropzone {
    flex-grow: 1;
    border: 2px dashed rgba(109, 40, 217, 0.4);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(109, 40, 217, 0.05);
    margin-bottom: 1.5rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-secondary);
    background: rgba(14, 165, 233, 0.08);
    transform: translateY(-2px);
}

.drop-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.dropzone:hover .drop-icon {
    transform: translateY(-5px);
    color: var(--accent-secondary);
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sub-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.highlight {
    color: var(--accent-secondary);
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.type-icon {
    font-size: 2rem;
    color: #ef4444;
    /* Defaults to red for PDF */
}

.file-info .details h4 {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-info .details span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.icon-btn:hover {
    color: var(--error);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px -10px var(--accent-glow);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--accent-glow);
    filter: brightness(1.1);
}

.primary-btn:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Results Panel */
.results-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-idle {
    background: rgba(71, 85, 105, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(71, 85, 105, 0.4);
}

.status-running {
    background: rgba(14, 165, 233, 0.2);
    color: var(--accent-secondary);
    border: 1px solid rgba(14, 165, 233, 0.5);
}

.status-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Stepper */
.stepper {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed .step-indicator {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step.error .step-indicator {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.step.active .step-indicator {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.step-content h4 {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.step-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.step-line {
    height: 24px;
    width: 2px;
    background: var(--border-glass);
    margin-left: 15px;
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.step-line.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-secondary), transparent);
    animation: scanLine 1.5s linear infinite;
}

@keyframes scanLine {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.step-line.completed {
    background: var(--success);
}

/* Enhancing Micro-Animations */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 10px 20px -10px var(--accent-glow);
    }

    50% {
        box-shadow: 0 15px 35px -5px var(--accent-glow), 0 0 15px var(--accent-primary);
        filter: brightness(1.2);
    }

    100% {
        box-shadow: 0 10px 20px -10px var(--accent-glow);
    }
}

.primary-btn:not(:disabled) {
    animation: pulse-glow 3s infinite alternate;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step.active .step-content {
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes drawCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.step.completed .step-indicator i {
    animation: drawCheck 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.results-viewer pre {
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Results Viewer */
.results-viewer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent-secondary);
    border-bottom: 2px solid var(--accent-secondary);
    background: rgba(14, 165, 233, 0.05);
}

.tab-content {
    display: none;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    margin: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
}

.text-block {
    line-height: 1.6;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

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

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

#processBtn {
    width: 100%;
    align-items: center;
    justify-content: center;
}

/* Footer */
.glass-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    margin-top: 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.glass-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.glass-footer a {
    color: var(--accent-secondary);
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.glass-footer a:hover {
    text-decoration: underline;
}

/* Privacy Page Specifics */
.privacy-content {
    animation: fadeIn 0.8s ease;
}

.privacy-content h1 {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, white, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* Recent Activity Section */
.activity-section {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-container {
    overflow-x: auto;
    width: 100%;
}

.activity-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}

.activity-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.activity-table td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.activity-table tr td:first-child {
    border-left: 1px solid var(--border-glass);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.activity-table tr td:last-child {
    border-right: 1px solid var(--border-glass);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.activity-table tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: var(--accent-secondary);
    background: rgba(14, 165, 233, 0.1);
}

.delete-btn:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 50%;
}

.refresh-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
    transform: rotate(180deg);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-processing, .status-running {
    background: rgba(109, 40, 217, 0.15);
    color: var(--accent-primary);
}

.status-failed, .status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}
