:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-gradient-1: #c084fc;
    --bg-gradient-2: #6366f1;
    --bg-gradient-3: #f472b6;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    --success-color: #10b981;
    --error-color: #ef4444;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 24px;
}

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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    position: relative;
    padding: 20px;
}

/* Background Blobs */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: blobMove 10s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--bg-gradient-1);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--bg-gradient-2);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-direction: alternate-reverse;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 300px;
    height: 300px;
    background: var(--bg-gradient-3);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-duration: 15s;
}

@keyframes blobMove {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(50px, 50px) rotate(20deg);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 550px;
    position: relative;
    z-index: 10;
}

.upload-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-2xl);
    padding: 40px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    transition: transform var(--transition-normal);
}

.card-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.card-header p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #9ca3af;
    border-radius: var(--border-radius-xl);
    padding: 40px 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.3);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.02);
}

.icon-container {
    margin-bottom: 16px;
    color: var(--primary-color);
}

.upload-icon {
    width: 48px;
    height: 48px;
}

.drop-zone h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

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

.browse-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

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

/* Progress */
.progress-container {
    margin-top: 24px;
    text-align: left;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    width: 100%;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    min-width: 0;
    flex: 1;
}

.upload-status {
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(209, 213, 219, 0.5);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bg-gradient-1), var(--bg-gradient-2));
    border-radius: var(--border-radius-sm);
    transition: width 0.4s ease;
}

/* Status Messages */
.status-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 500;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Results */
.results-container {
    margin-top: 24px;
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
}

.history-list {
    margin-top: 24px;
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
}

.result-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-lg);
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform var(--transition-fast);
}

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

.preview-link {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
    display: block;
}

.result-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    background-color: rgba(255, 255, 255, 0.5);
    transition: transform var(--transition-normal), filter var(--transition-normal);
    display: block;
}

.preview-link:hover .result-preview {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.result-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.file-link:hover {
    text-decoration: underline;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-left: 10px;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.copy-btn.copied {
    background: var(--success-color);
}

/* Scrollbar */
.results-container::-webkit-scrollbar {
    width: 6px;
}

.results-container::-webkit-scrollbar-track {
    background: transparent;
}

.results-container::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

/* History List Scrollbar - Match Results Container */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.3);
    padding: 6px;
    border-radius: var(--border-radius-lg);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

/* Focus Visible for Accessibility */
.tab-btn:focus-visible,
.browse-btn:focus-visible,
.copy-btn:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--bg-gradient-2), var(--bg-gradient-1));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

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

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

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-normal);
    z-index: 1010;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
}

/* Confirmation Modal */
.confirm-content {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.confirm-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.secondary-btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius-md);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f3f4f6;
    border-color: #b0b0b0;
}

.danger-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--error-color);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.danger-btn:hover {
    background: #dc2626;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: white;
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    pointer-events: auto;
    animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary-color);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--error-color); }

.toast.hiding {
    animation: fadeOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .upload-card {
        padding: 24px;
    }

    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex-basis: 100%;
    }
}