:root {
    --bg-color: #0a0a1a;
    --card-bg: #1a1a2e;
    --accent-color: #4ecca3;
    --accent-hover: #45b591;
    --error-color: #ff6b6b;
    --warning-color: #ffd93d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a4a;
    --queued-color: #6c757d;
    --uploading-color: #3b82f6;
    --complete-color: #10b981;
    --overlay-bg: rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}
.active {
    display: flex !important;
}

/* Screens */
.screen {
    min-height: 100vh;
    display: none;
    flex-direction: column;
}
#screen-access {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
    outline: none;
}
.btn-primary {
    background-color: var(--accent-color);
    color: #000;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
.btn-block {
    width: 100%;
}
.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s;
}
.icon-btn:hover {
    color: var(--text-primary);
}
.hidden-input {
    display: none;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(78, 204, 163, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Typography refinements */
.card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #ffffff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Icons */
.icon-container {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(78, 204, 163, 0.15), rgba(78, 204, 163, 0.05));
    border: 1px solid rgba(78, 204, 163, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 15px rgba(78, 204, 163, 0.1);
}
.lock-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-color);
}
.eye-icon {
    width: 20px;
    height: 20px;
}
.cloud-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Forms */
.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}
input:focus {
    outline: none;
    border-color: var(--accent-color);
}
#toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

/* Dashboard Main */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 120px; /* Space for sticky bar */
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    background-color: rgba(26, 26, 46, 0.5);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}
.drop-zone.dragover {
    border-color: var(--accent-color);
    background-color: rgba(78, 204, 163, 0.05);
}
.or-text {
    color: var(--text-secondary);
    margin: 1rem 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.drop-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Upload Queue */
#upload-queue-container {
    margin-top: 2rem;
}
#upload-queue-container h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.upload-queue {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.file-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    transition: background-color 0.2s;
}
.file-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}
.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}
.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.file-progress-container {
    height: 4px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}
.file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #2ab78a);
    width: 0%;
    transition: width 0.3s linear;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-queued { background-color: rgba(108, 117, 125, 0.2); color: #adb5bd; }
.status-uploading { 
    background-color: rgba(59, 130, 246, 0.2); 
    color: #60a5fa;
    animation: pulse 2s infinite;
}
.status-complete { background-color: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-error { background-color: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-retrying { background-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-paused { background-color: rgba(156, 163, 175, 0.2); color: #9ca3af; }

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

/* Stats Bar (Sticky Bottom) */
.stats-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}
.stats-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.stat {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.stat-value {
    font-weight: 600;
    font-size: 1.125rem;
}
.overall-progress-track {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
}
.overall-progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s linear;
}

/* Slide-in Panel */
.side-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    z-index: 100;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}
.side-panel.open {
    right: 0;
}
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.remote-file-item {
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.remote-file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-all;
}
.remote-file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(78, 204, 163, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
    .dashboard-header { padding: 1rem; }
    .dashboard-main { padding: 1rem; }
    .drop-zone { padding: 2rem 1rem; }
    .drop-actions { flex-direction: column; }
    .stats-info { gap: 1rem; }
    .stat-value { font-size: 1rem; }
    .file-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem;
    }
    .status-badge { align-self: flex-start; justify-self: flex-start; }
}
