:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --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;
}

* {
    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;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    /* Allow horizontal scrolling */
    overflow-y: auto;
    position: relative;
    padding-top: 120px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #7c3aed;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #2563eb;
    top: 50%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.1);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 100%;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* Top-align boxes to prevent jumping when content expands */
    justify-content: center;
    gap: 30px;
    padding: 0;
}

.app-container.wide {
    width: auto;
}

.app-header {
    position: fixed;
    top: 30px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    z-index: 100;
}

.main-title {
    font-family: 'Courier New', Courier, monospace;
    /* Monospaced font for perfect typewriter effect */
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    margin: 0;

    /* Typewriter animation */
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 4px solid transparent;
    /* Set to transparent by default */
    width: 0;
    animation:
        typing 2s steps(18, end) forwards,
        blink-caret 0.5s step-end 4;
    /* Blinks for 2 seconds, then stops (reverting to transparent) */
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-view-results-header {
    background: rgba(79, 70, 229, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-view-results-header:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.logout-button {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.logout-button:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 18ch
    }
}

@keyframes blink-caret {

    50% {
        border-color: var(--primary)
    }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    /* 20% smaller: 40 * 0.8 = 32 */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    position: relative;
    /* Removed overflow: hidden to prevent button/shadow cutoff */
}

/* States */
.state {
    display: flex;
    /* Always display */
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    width: 360px;
    /* 20% smaller: 450 * 0.8 = 360 */
    min-width: 320px;
    max-width: 400px;
    flex-shrink: 1;
    /* Allow shrinking on smaller screens */
    opacity: 0.1;
    /* Very dimmed initially */
    filter: grayscale(100%) blur(5px);
    transform: scale(0.85);
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.state.active {
    opacity: 1;
    filter: grayscale(0%) blur(0px);
    transform: scale(1.05);
    /* Slightly bigger when active */
    pointer-events: all;
    z-index: 5;
}

.state.active .glass-card {
    border-color: var(--primary);
    box-shadow: 0 0 60px rgba(79, 70, 229, 0.4);
}

.state.completed {
    opacity: 0.5;
    filter: grayscale(40%) blur(0px);
    transform: scale(0.95);
    pointer-events: none;
}


/* Hero Content */
.icon-badge {
    font-size: 2.4rem;
    /* 20% smaller: 3 * 0.8 = 2.4 */
    margin-bottom: 16px;
}

h1 {
    font-size: 1.76rem;
    /* 20% smaller: 2.2 * 0.8 = 1.76 */
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.28rem;
    /* 20% smaller: 1.6 * 0.8 = 1.28 */
    margin-bottom: 12px;
}

p {
    color: var(--text-muted);
    font-size: 0.8rem;
    /* 20% smaller: 1 * 0.8 = 0.8 */
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Buttons */
.btn-back {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(-2px);
}

.btn-back svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.btn-back:hover svg {
    transform: translateX(-2px);
}

.btn-template {
    background: rgba(79, 70, 229, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    /* 20% smaller: 12*0.8=9.6, 24*0.8=19.2 */
    border-radius: 8px;
    font-size: 0.76rem;
    /* 20% smaller: 0.95 * 0.8 = 0.76 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
    margin-bottom: 16px;
}

.btn-template:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-template svg {
    transition: transform 0.3s ease;
}

.btn-template:hover svg {
    transform: translateY(2px);
}

.btn-download-results {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 13px 26px;
    /* 20% smaller */
    border-radius: 10px;
    font-size: 0.88rem;
    /* 20% smaller: 1.1 * 0.8 = 0.88 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
    margin-bottom: 12px;
    width: 100%;
}

.btn-download-results:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(245, 158, 11, 0.5);
}

.btn-download-results:active:not(:disabled) {
    transform: translateY(0);
}

.btn-download-results:disabled {
    background: #334155;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.5;
}

/* Start Page Download Progress Bar */
.start-download-progress {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.start-download-progress .download-info-text {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Preparing animation - continuous flow from left to right */
.start-download-progress .download-progress-bar.preparing {
    width: 100% !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(245, 158, 11, 0.3) 20%,
        rgba(245, 158, 11, 0.6) 50%,
        rgba(245, 158, 11, 0.3) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: preparingFlow 1.5s linear infinite;
}

@keyframes preparingFlow {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Downloading animation - pulse effect while waiting for progress */
.start-download-progress .download-progress-bar.downloading {
    width: 100% !important;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.3) 0%,
        rgba(99, 102, 241, 0.6) 25%,
        rgba(16, 185, 129, 0.6) 50%,
        rgba(99, 102, 241, 0.6) 75%,
        rgba(99, 102, 241, 0.3) 100%
    );
    background-size: 200% 100%;
    animation: downloadingFlow 1s linear infinite;
}

@keyframes downloadingFlow {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 13px 26px;
    /* 20% smaller: 16*0.8=12.8, 32*0.8=25.6 */
    border-radius: 10px;
    font-size: 0.88rem;
    /* 20% smaller: 1.1 * 0.8 = 0.88 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(79, 70, 229, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #334155;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.5;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--glass-border);
}

.btn-restart-premium {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.btn-restart-premium:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(16, 185, 129, 0.6);
    filter: brightness(1.1);
}

.btn-restart-premium:active {
    transform: translateY(-1px) scale(0.98);
}

/* Upload Area */
.upload-area {
    width: 100%;
    border: 2px dashed var(--glass-border);
    border-radius: 14px;
    padding: 32px;
    /* 20% smaller: 40 * 0.8 = 32 */
    margin-bottom: 20px;
    transition: 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.upload-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
    transition: 0.3s;
}

.upload-icon svg {
    width: 38px;
    /* 20% smaller: 48 * 0.8 = 38.4 */
    height: 38px;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
    color: white;
}

.upload-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    /* 20% smaller */
}

.upload-text span {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.file-info {
    margin-top: 15px;
    font-weight: 600;
    color: var(--success);
}

/* Step Indicator */
.step-indicator {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
}

/* Success Content */
.success-icon-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 50px var(--success);
    }
}

.success-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 30px;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item span {
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .glass-card {
        padding: 25px;
        min-height: 400px;
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* Excel Preview & Metadata Styling */
.wide-card {
    max-width: 1000px;
    align-self: center;
}

.preview-area {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    animation: fadeIn 0.5s ease forwards;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

#excel-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

#excel-preview-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
}

#excel-preview-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    color: var(--text-main);
}

#excel-preview-table td:empty {
    background: rgba(255, 255, 255, 0.02);
}

#excel-preview-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

#excel-preview-table tr:last-child td {
    border-bottom: none;
}

/* Action Bar Adjustment */
.action-bar {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 20px;
}

#btn-excel-upload,
#btn-zip-upload,
.action-bar .btn-primary,
.action-bar .btn-secondary {
    font-size: 0.8rem !important;
    padding: 12px 5px !important;
    /* Extra compact to fit 3 buttons */
    margin-right: 0 !important;
    flex: 1 !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    height: 44px;
    /* Fixed height for uniformity */
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-excel-upload.success,
#btn-zip-upload.success {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    font-size: 0.75rem !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInModal 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--primary);
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(79, 70, 229, 0.2);
    animation: slideUpModal 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-close:hover {
    color: white;
    transform: rotate(90deg);
}

#btn-excel-info,
#btn-zip-status {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#btn-excel-info:hover,
#btn-zip-status:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* ZIP Upload Status Modal Styles */
.upload-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

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

.error-text {
    color: #ef4444;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 20px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.upload-list-container {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.upload-item-name {
    flex: 1;
    color: var(--text-main);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
}

.upload-item-status {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.upload-item.pending {
    border-left-color: var(--text-muted);
}

.upload-item.pending .upload-item-status {
    color: var(--text-muted);
}

.upload-item.uploading {
    border-left-color: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.upload-item.uploading .upload-item-status {
    color: var(--primary);
}

.upload-item.success {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.upload-item.success .upload-item-status {
    color: var(--success);
}

.upload-item.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.upload-item.error .upload-item-status {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Custom scrollbar for upload list */
.upload-list-container::-webkit-scrollbar {
    width: 8px;
}

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

.upload-list-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.upload-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Column Error Modal Styles */
.required-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.column-item {
    background: rgba(79, 70, 229, 0.1);
    border: 2px solid var(--primary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.column-name {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.column-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    font-family: 'Outfit', sans-serif;
}

/* Upload Progress Bar Styles */
.upload-progress-container {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.upload-progress-label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-progress-percent {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.upload-progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, #7c3aed 50%, var(--success) 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.upload-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.upload-progress-text {
    margin-top: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Process Result Modal Styles */
.process-result-modal {
    max-width: 480px;
    text-align: center;
    padding: 40px;
}

.process-result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--success) 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-checkmark {
    width: 40px;
    height: 40px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.result-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}

.result-checkmark__check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCircle {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes strokeCheck {
    100% {
        stroke-dashoffset: 0;
    }
}

.process-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.process-result-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.process-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-total {
    background: rgba(79, 70, 229, 0.2);
    color: var(--primary);
}

.stat-icon-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-icon-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-value.stat-success {
    color: var(--success);
}

.stat-value.stat-failed {
    color: #ef4444;
}

.process-output-folder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 28px;
    border: 1px solid var(--glass-border);
}

.folder-icon {
    font-size: 1.2rem;
}

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

.folder-name {
    color: var(--primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.process-result-btn {
    width: 100%;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
}

/* =====================================================
   MODERN PROCESS RESULT MODAL STYLES
   ===================================================== */

.process-result-modal-modern {
    max-width: 420px;
    text-align: center;
    padding: 48px 40px 40px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Background Decorations */
.modal-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.modal-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.modal-circle-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    top: -80px;
    right: -60px;
    animation: floatCircle 8s ease-in-out infinite;
}

.modal-circle-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    bottom: -50px;
    left: -40px;
    animation: floatCircle 8s ease-in-out infinite reverse;
}

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* Modern Icon */
.process-result-icon-modern {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
    z-index: 1;
}

.icon-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

.icon-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #06b6d4, #6366f1) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateRing 4s linear infinite;
}

@keyframes rotateRing {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.result-checkmark-modern {
    position: absolute;
    inset: 15px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.5);
}

.result-checkmark__check-modern {
    stroke: white;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.5s ease-out 0.3s forwards;
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Modern Title & Message */
.process-result-title-modern {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.process-result-message-modern {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

/* Modern Stats Cards */
.process-stats-modern {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.stat-card {
    flex: 1;
    max-width: 110px;
    padding: 3px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card-inner {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-card-total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
}

.stat-card-total:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.stat-card-total .stat-number {
    color: #a5b4fc;
}

.stat-card-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
}

.stat-card-success:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.stat-card-success .stat-number {
    color: #6ee7b7;
}

.stat-card-failed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(249, 115, 22, 0.3) 100%);
}

.stat-card-failed:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.stat-card-failed .stat-number {
    color: #fca5a5;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label-modern {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Download Progress Section */
.modal-download-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-progress-label span:last-child {
    color: var(--primary);
    font-weight: 700;
}

.download-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.download-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

/* Modal Action Buttons */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.btn-modal-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-modal-download:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-modal-download:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-modal-download:disabled {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.btn-modal-download svg {
    transition: transform 0.3s ease;
}

.btn-modal-download:hover:not(:disabled) svg {
    transform: translateY(2px);
}

.btn-modal-close {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal-close:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Error State for Modal */
.process-result-modal-modern.error-state .icon-glow {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
}

.process-result-modal-modern.error-state .icon-ring {
    background: linear-gradient(135deg, #ef4444, #f97316, #fbbf24) border-box;
}

.process-result-modal-modern.error-state .result-checkmark-modern {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.5);
}

.process-result-modal-modern.error-state .modal-circle-1 {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.process-result-modal-modern.error-state .modal-circle-2 {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
}

/* Spin Animation for Loading Icons */
.btn-modal-download svg.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Results List Modal Styles */
.results-folders-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    min-height: 200px;
}

.results-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.results-folder-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.results-folder-item.downloading {
    cursor: not-allowed;
    opacity: 0.6;
}

.folder-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.folder-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.folder-download-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-download-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.folder-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.folder-download-btn svg {
    width: 16px;
    height: 16px;
}

/* Results Pagination */
.results-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

/* Empty state */
.results-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.results-empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.results-empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.results-empty-state p {
    font-size: 0.9rem;
}

/* Loading state */
.results-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.results-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}
/* Active Work Session Modal Specific Styles */
#active-work-modal .modal-content {
    max-width: 500px;
}

#active-work-modal .modal-header h2 {
    color: #ff9800;
}

.active-work-info {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
}

#active-work-modal .modal-actions {
    margin-top: 30px;
}
