:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success-color: #10b981;
    --error-color: #ef4444;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-color);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

h1 {
    font-weight: 600;
    letter-spacing: -0.5px;
    font-size: 28px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 300;
}

/* Upload Card */
.upload-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.upload-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.upload-card.drag-over {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.05);
}

.icon-container {
    margin-bottom: 24px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.upload-card:hover .icon-container {
    color: var(--accent-color);
}

.upload-icon {
    transition: transform 0.3s;
}

.upload-card:hover .upload-icon {
    transform: translateY(-5px);
}

h2 {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 8px;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Progress Section */
.progress-container {
    display: none;
    margin-top: 20px;
    text-align: left;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
}

#file-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    background: var(--accent-color);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.upload-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Files Section */
.files-section {
    margin-top: 20px;
}

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

h3 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.btn-refresh {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

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

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    gap: 15px;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    flex: 1;
}

.file-thumb {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    color: var(--text-secondary);
}

.file-details {
    overflow: hidden;
}

.file-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.file-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-download {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.05);
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-item {
    animation: fadeIn 0.5s ease forwards;
}

/* Form Styles */
.file-details-form label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 16px;
}

.file-details-form input,
.file-details-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
    resize: vertical;
}

.file-details-form input:focus,
.file-details-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.05);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.selected-file-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.sfs-name {
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    color: var(--text-primary);
}

.sfs-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Download Overlay */
.download-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.download-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.download-overlay.hiding .download-spinner-container {
    animation: motionBlurOut 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.download-overlay.hiding {
    opacity: 0;
    transition: opacity 0.5s ease 0.2s; /* delays fading background slightly after scaling */
}

@keyframes motionBlurOut {
    0% {
        opacity: 1;
        filter: blur(0px);
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        filter: blur(15px);
        transform: scale(0.9) translateY(40px);
    }
}

.download-spinner-container {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    min-width: 320px;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dl-state {
    position: absolute;
    width: 100%;
    padding: 30px 40px;
    transition: all 0.6s cubic-bezier(0.87, 0, 0.13, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dl-state-loading {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1) translateY(0);
}

.dl-state-loading.animate-out {
    opacity: 0;
    filter: blur(15px);
    transform: scale(1.1) translateY(-30px);
    pointer-events: none;
}

.dl-state-success {
    opacity: 0;
    filter: blur(15px);
    transform: scale(0.9) translateY(30px);
    pointer-events: none;
}

.dl-state-success.animate-in {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1) translateY(0);
}

.success-icon-svg {
    color: var(--success-color);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}


.download-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

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

