/* ===== Variables ===== */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-card: rgba(30, 30, 30, 0.8);
    --bg-card-hover: rgba(40, 40, 40, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.login-icon svg {
    color: white;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrapper:focus-within svg {
    color: var(--accent-primary);
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* ===== App Layout ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.app-main {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Upload Section ===== */
.upload-section {
    margin-bottom: 32px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    transform: scale(1.01);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    margin-bottom: 20px;
    color: var(--accent-primary);
    transition: all var(--transition-normal);
}

.upload-area:hover .upload-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-link {
    color: var(--accent-primary);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Progress Bar */
.upload-progress {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.progress-filename {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-percent {
    color: var(--accent-primary);
    font-weight: 600;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===== Files Section ===== */
.files-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.files-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.files-header h2 svg {
    color: var(--accent-primary);
}

.file-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    background: var(--accent-primary);
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 0.9rem;
}

/* Files Grid */
.files-grid {
    display: flex;
    flex-direction: column;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.file-card:last-child {
    border-bottom: none;
}

.file-card:hover {
    background: var(--bg-card-hover);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.file-icon.apk { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.file-icon.zip, .file-icon.rar, .file-icon.7z { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.file-icon.exe, .file-icon.msi { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.file-icon.pdf { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.file-icon.mp4, .file-icon.avi, .file-icon.mkv, .file-icon.mov { color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.file-icon.mp3 { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.file-icon.jpg, .file-icon.jpeg, .file-icon.png, .file-icon.gif { color: #14b8a6; background: rgba(20, 184, 166, 0.1); }

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.file-card:hover .file-actions {
    opacity: 1;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.btn-copy:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.btn-download:hover { color: var(--success); border-color: var(--success); }
.btn-delete:hover { color: var(--danger); border-color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.toast.success .toast-message {
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.toast.error .toast-message {
    color: var(--danger);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    margin-bottom: 20px;
    color: var(--danger);
}

.modal h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.modal p strong {
    color: var(--text-primary);
    word-break: break-all;
}

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

.btn-cancel, .btn-confirm {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.btn-confirm {
    background: var(--danger);
    border: none;
    color: white;
}

.btn-confirm:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px var(--danger-glow);
}

/* ===== Animations ===== */
@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-20px); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
    }
    
    .logo span {
        display: none;
    }
    
    .app-main {
        padding: 16px;
    }
    
    .upload-area {
        padding: 32px 20px;
    }
    
    .upload-icon {
        width: 64px;
        height: 64px;
    }
    
    .file-card {
        padding: 12px 16px;
    }
    
    .file-icon {
        width: 40px;
        height: 40px;
    }
    
    .file-actions {
        opacity: 1;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .login-card {
        padding: 28px;
    }
    
    .modal {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .files-header {
        padding: 16px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-action {
        width: 32px;
        height: 32px;
    }
    
    .user-info {
        display: none;
    }
}
