:root {
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --primary: #4F46E5;
    --primary-hover: #6366f1;
    --secondary: #374151;
    --secondary-hover: #4B5563;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border: #374151;
    --success: #10B981;
    --error: #EF4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden { display: none !important; }
.desktop-only { display: inline-flex; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
}

/* Authentication Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 17, 21, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.overlay:not(.active) {
    display: none;
}

.auth-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.auth-card h2 i { color: var(--primary); }

.auth-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-card input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-card button {
    width: 100%;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-card button:hover { background: var(--primary-hover); }

.error-msg {
    color: var(--error) !important;
    font-size: 0.85rem !important;
    margin-top: 1rem;
    margin-bottom: 0 !important;
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
    background: var(--card-bg);
}

#logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

#logout-btn:hover { color: var(--error); }

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg);
    transition: all 0.2s ease;
    margin-bottom: 2rem;
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.drop-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.drop-zone h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.upload-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

input[type="file"] {
    display: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--surface-light);
    color: var(--text-main);
}

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

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.delete-btn:hover {
    background: var(--error);
    color: white;
}

/* Quick Note Zone */
.quick-note-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.quick-note-container input {
    flex: 1;
    margin-bottom: 0;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Progress Bar */
#upload-progress-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* File List */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* File Cards */
.file-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.file-checkbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    z-index: 10;
}

.file-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.file-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
    padding: 1.5rem 0;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 0.5rem;
}

/* Media previews */
.file-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: #000;
}

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

.file-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    color: var(--text-main);
}

.action-btn.delete-btn:hover {
    color: var(--error);
}

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

/* Floating Action Bar */
#bulk-action-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 32, 40, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}

#bulk-action-bar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
}

.bulk-actions {
    display: flex;
    gap: 1rem;
}

@media (max-width: 600px) {
    .quick-note-container {
        flex-direction: column;
    }
    #bulk-action-bar {
        width: 90%;
        padding: 1rem;
        border-radius: 12px;
        flex-direction: column;
        gap: 1rem;
    }
    .bulk-actions {
        width: 100%;
        justify-content: space-between;
    }
}
