:root {
    /* Light Mode (Default) */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #e0e7ff;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    /* Neumorphic Shadows - Light */
    --neumorph-inner: inset 2px 2px 5px rgba(209, 213, 219, 0.6), inset -2px -2px 5px rgba(255, 255, 255, 1);
    --neumorph-outer: 3px 3px 6px rgba(166, 171, 189, 0.4), -3px -3px 6px rgba(255, 255, 255, 1);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: #2d3748;
    /* Darker Slate */
    --card-bg: #1a202c;
    /* Slick Dark */
    --text-main: #f7fafc;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --accent-color: #4c51bf;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);

    /* Neumorphic Shadows - Dark */
    --neumorph-inner: inset 3px 3px 7px rgba(13, 16, 22, 0.6), inset -2px -2px 5px rgba(55, 65, 81, 0.5);
    --neumorph-outer: 4px 4px 8px rgba(18, 22, 31, 0.6), -3px -3px 7px rgba(55, 65, 81, 0.4);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

/* Neumorphic Switch */
.theme-switch {
    position: absolute;
    right: 0;
    width: 140px;
    height: 44px;
    background-color: var(--bg-color);
    border-radius: 50px;
    box-shadow: var(--neumorph-inner);
    display: flex;
    align-items: center;
    padding: 4px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    overflow: hidden;
}

.theme-switch:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.switch-handle {
    width: 36px;
    height: 36px;
    background-color: var(--bg-color);
    /* Handle matches bg */
    border-radius: 50%;
    box-shadow: var(--neumorph-outer);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: absolute;
    left: 4px;
    /* Start position */
    transition: var(--transition);
    z-index: 2;
}

.switch-text {
    position: absolute;
    right: 18px;
    /* Position for "LIGHT MODE" */
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: var(--transition);
}

/* Dark Mode State for Switch */
body.dark-mode .theme-switch {
    background-color: var(--card-bg);
    /* Darker track */
}

body.dark-mode .switch-handle {
    background-color: var(--card-bg);
    /* Darker handle */
    transform: translateX(96px);
    /* Move rights (140 - 36 - 8 padding) */
    color: var(--text-main);
}

body.dark-mode .switch-text {
    right: auto;
    left: 18px;
    /* Position for "DARK MODE" */
    color: var(--text-secondary);
}

body.dark-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: block !important;
}

/* Hover effects */
.theme-switch:hover .switch-handle {
    color: var(--primary-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.logo svg {
    color: var(--primary-color);
}

.tagline {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1.1rem;
}

/* Drop Zone */
.drop-zone {
    background-color: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: var(--accent-color);
}

.drop-content h3 {
    margin: 1rem 0 0.5rem;
    font-weight: 500;
}

.drop-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* File List */
.file-list-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease-out;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.list-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
}

.file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: grab;
}

.file-item:active {
    cursor: grabbing;
}

.file-item:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.file-icon {
    color: var(--danger-color);
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.remove-btn {
    background: var(--bg-color);
    /* Matches theme background */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 1;
    /* Full opacity */
}

.remove-btn:hover {
    background-color: #fee2e2;
    border-color: #fee2e2;
    color: var(--danger-color);
}

.remove-btn svg {
    display: block;
    /* Ensure it behaves as a block to fill space if needed */
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    animation: slideUp 0.3s ease-out;
}

/* Buttons */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--card-bg);
    /* Adapts to theme */
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary .btn-text {
    color: white;
}

.btn-text:hover {
    color: var(--danger-color);
    text-decoration: underline;
}

.btn-primary .btn-text:hover {
    color: white;
    text-decoration: none;
}

.large {
    width: 100%;
    font-size: 1.1rem;
    padding: 1rem;
}

/* Footer */
footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .file-name {
        max-width: 200px;
    }
}