@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Core Colors */
    --bg-dark: #09090b;
    /* Zinc 950 */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #020617;

    /* Glass Effect Tokens */
    --glass-bg: rgba(17, 25, 40, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);

    /* Accents */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    /* Pink 500 */
    --accent: #8b5cf6;
    /* Violet 500 */

    /* Text */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-on-accent: #ffffff;

    /* Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --warning: #f59e0b;

    /* Transitions */
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* --- Animated Background Blobs --- */
.background-blobs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float-blob 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: 30%;
    left: 20%;
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes float-blob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* --- Main Glass Container --- */
.glass-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 520px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* More highlight on top */
    border-radius: 32px;
    padding: 3rem 2.5rem;
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fade-in-up 0.8s var(--ease-out-back);
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Header --- */
header {
    text-align: center;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.2);
}

.icon-container {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.upload-zone:hover .icon-container {
    color: var(--primary);
    transform: scale(1.05);
}

.upload-zone h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.file-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

/* --- Buttons --- */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glow-button {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-smooth);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.glow-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-button:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.5);
}

.glow-button:hover::before {
    opacity: 1;
}

.glow-button:active:not([disabled]) {
    transform: translateY(1px);
}

.glow-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.secondary-button {
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-smooth);
    width: 100%;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.secondary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.secondary-button:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.secondary-button:hover::before {
    opacity: 1;
}

.secondary-button:active:not([disabled]) {
    transform: translateY(1px);
}

.secondary-button:disabled {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    text-shadow: none;
    transform: none;
    opacity: 0.5;
}

/* --- File List --- */
.file-list-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    max-height: 320px;
    min-height: 120px;
    transition: all 0.3s ease;
}

.table-header {
    display: flex;
    padding: 0 0.5rem 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.file-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 4px;
    /* Space for scrollbar */
}

/* Scrollbar styling */
.file-list::-webkit-scrollbar {
    width: 4px;
}

.file-list::-webkit-scrollbar-track {
    background: transparent;
}

.file-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* File Row */
.file-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    background: transparent;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.col-name {
    flex: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.col-status {
    flex: 1;
    font-size: 0.85em;
    font-weight: 500;
}

.col-action {
    flex: 0 0 140px;
    display: flex;
    justify-content: flex-end;
}

/* Status States */
.status-waiting {
    color: var(--text-muted);
}

.status-cracking {
    color: var(--primary);
    animation: pulse 2s infinite;
}

.status-success {
    color: var(--success);
}

.status-failed {
    color: var(--error);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Small Action Button */
.row-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.row-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    transform: translateY(-1px);
}

/* --- Result Overlay (from original code, just refreshed styles) --- */
.result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: all;
}