/* -------------------------------------------------------------
 * STYLE.CSS - Premium Design System for Scan to Download on Phone
 * ------------------------------------------------------------- */

/* Theme Presets & Color Palette */
:root, [data-theme="cyberpunk"] {
    --bg-main: #090d16;
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --grad-primary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --border-color-glow: rgba(0, 242, 254, 0.3);
    --grad-glow: linear-gradient(90deg, #00f2fe, #7f00ff, #ff2a54, #00f2fe);
}

[data-theme="emerald"] {
    --bg-main: #060d0a;
    --accent-cyan: #10b981;
    --accent-blue: #34d399;
    --grad-primary: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --border-color-glow: rgba(16, 185, 129, 0.3);
    --grad-glow: linear-gradient(90deg, #10b981, #047857, #6ee7b7, #10b981);
}

[data-theme="ocean"] {
    --bg-main: #050b14;
    --accent-cyan: #3b82f6;
    --accent-blue: #60a5fa;
    --grad-primary: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    --border-color-glow: rgba(59, 130, 246, 0.3);
    --grad-glow: linear-gradient(90deg, #3b82f6, #1e40af, #93c5fd, #3b82f6);
}

[data-theme="sunset"] {
    --bg-main: #0e0a07;
    --accent-cyan: #f97316;
    --accent-blue: #fb923c;
    --grad-primary: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    --border-color-glow: rgba(249, 115, 22, 0.3);
    --grad-glow: linear-gradient(90deg, #f97316, #c2410c, #fdba74, #f97316);
}

:root {
    --bg-card: rgba(17, 25, 40, 0.6);
    --bg-card-hover: rgba(23, 33, 53, 0.7);
    --border-color: rgba(255, 255, 255, 0.07);
    
    /* Vibrant gradients (shared fallback) */
    --accent-purple: #9f5afd;
    --accent-pink: #ff2a54;
    
    --grad-purple: linear-gradient(135deg, #7f00ff 0%, #e100ff 100%);
    --grad-royal: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Text colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Font definitions */
    --font-heading: 'Outfit', 'Kantumruy Pro', 'Kanit', sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Kantumruy Pro', 'Kanit', sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Blur Background Elements */
@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.15); }
    100% { transform: translate(0, 0) scale(1); }
}
@keyframes float-glow-reverse {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 40px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.bg-blur {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
}
.bg-blur-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-cyan);
    top: -150px;
    left: -150px;
    opacity: 0.18;
    animation: float-glow 20s infinite ease-in-out;
}
.bg-blur-2 {
    width: 700px;
    height: 700px;
    background: var(--accent-purple);
    bottom: -200px;
    right: -200px;
    opacity: 0.18;
    animation: float-glow-reverse 25s infinite ease-in-out;
}
.bg-blur-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-pink);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-glow);
}

/* App Container */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo-icon {
    position: relative;
    width: 52px;
    height: 52px;
    background: var(--grad-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #000;
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.3);
}

.logo-icon i:first-child {
    position: absolute;
    font-size: 0.8rem;
    top: 5px;
    right: 5px;
    color: var(--accent-purple);
}

.header-logo h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-logo .subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: var(--grad-primary);
    color: #020617;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
    opacity: 0.95;
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Language Switcher */
.language-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 3px;
}
.btn-lang {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-lang.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Settings Button */
.btn-settings {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-settings:hover, .btn-settings.active {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.05);
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 500px;
    opacity: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.settings-panel.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    border-color: transparent;
    padding-top: 0;
    padding-bottom: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
}
.panel-header h3 i {
    color: var(--accent-cyan);
}
.btn-close-panel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-close-panel:hover {
    color: var(--text-primary);
}

.panel-body {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media(min-width: 768px) {
    .panel-body {
        grid-template-columns: 1fr 1fr;
    }
    .panel-body .info-alert {
        grid-column: span 2;
    }
    .panel-body .form-group:nth-child(4) {
        grid-column: span 2;
    }
    .panel-body .panel-actions {
        grid-column: span 2;
    }
}

.info-alert {
    background: rgba(79, 172, 254, 0.08);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.info-alert i {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.select-wrapper {
    position: relative;
}
.select-wrapper select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}
.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}
.select-wrapper i {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.input-with-icon {
    position: relative;
}
.input-with-icon i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-with-icon input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.input-with-icon input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.base-url-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--accent-cyan);
    word-break: break-all;
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Cards Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    flex: 1;
}

@media(min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 2fr 3fr;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
    transform: translateY(-5px);
    border-color: var(--border-color-glow);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 25px var(--shadow-glow);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-glow);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 15px var(--shadow-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.count-badge {
    background: var(--grad-primary);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Drag & Drop Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(0, 0, 0, 0.15);
}

.upload-zone:hover, .upload-zone.dragging {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.02);
    box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.05);
}

.upload-zone.dragging {
    transform: scale(0.98);
}

.hidden-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.upload-icon-pulse {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.upload-zone:hover .upload-icon-pulse, .upload-zone.dragging .upload-icon-pulse {
    background: var(--grad-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    border-color: transparent;
    transform: scale(1.05);
}

.upload-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.upload-content .drag-drop-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-support-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    display: block;
}

/* Progress bar container */
.upload-progress-container {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.upload-progress-container h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.progress-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}
.progress-filename {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.progress-percentage {
    color: var(--accent-cyan);
    font-weight: 600;
}
.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--grad-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 100%;
}
@media(min-width: 576px) {
    .search-bar {
        width: 240px;
    }
}
.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-bar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    transition: all 0.2s;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15);
}

/* File History List States */
.file-list-wrapper {
    flex: 1;
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.list-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 3rem 1.5rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 1.5rem;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.list-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.list-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 320px;
}

/* File Table Styles */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.file-table th {
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.file-table td {
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.file-table tbody tr {
    transition: all 0.25s ease;
}
.file-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.035);
    box-shadow: inset 4px 0 0 var(--accent-cyan);
}

.text-right {
    text-align: right;
}

/* Cell Elements */
.file-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 240px;
}

.file-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Colors for specific file types */
.file-icon-video {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.file-icon-image {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.file-icon-pdf {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}
.file-icon-doc {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.file-icon-archive {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}
.file-icon-other {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.file-name-meta {
    overflow: hidden;
}
.file-name-title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.file-date-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.cell-size {
    color: var(--text-secondary);
    font-weight: 500;
}

.cell-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Table Actions */
.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.btn-action-qr {
    background: rgba(0, 242, 254, 0.05);
    border-color: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
}
.btn-action-qr:hover {
    background: var(--grad-primary);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
    border-color: transparent;
}

.btn-action-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Utility Class */
.hidden {
    display: none !important;
}

/* Footer Bar */
.app-footer-bar {
    margin-top: auto;
    padding-top: 3rem;
    text-align: center;
}
.app-footer-bar p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* PREMIUM MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 13, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: rgba(13, 19, 33, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    width: 90%;
    max-width: 440px;
    padding: 2.2rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 
                inset 0 0 30px rgba(255, 255, 255, 0.02);
}

.modal-overlay:not(.hidden) .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-title-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--accent-cyan);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.modal-title-logo i {
    font-size: 1.25rem;
    animation: pulseGlow 2s infinite ease-in-out;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; text-shadow: 0 0 5px rgba(0,242,254,0.2); }
    50% { opacity: 1; text-shadow: 0 0 15px rgba(0,242,254,0.6); }
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.4rem;
}

/* QR Code Container Styling */
.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.qr-border-glow {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4),
                0 0 25px rgba(0, 242, 254, 0.05);
    position: relative;
}

#qr-canvas-container {
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    border-radius: 12px;
}

/* Modal File Details */
.modal-file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.modal-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.modal-file-info {
    overflow: hidden;
    line-height: 1.3;
}
.modal-file-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-file-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* URL Copy Box */
.url-copy-box {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3px;
    align-items: center;
}
.url-copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 100%;
}
.url-copy-box input:focus {
    outline: none;
}
.url-copy-box .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 9px;
    flex-shrink: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(13, 20, 35, 0.95);
    border-left: 4px solid var(--accent-cyan);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    min-width: 280px;
    max-width: 360px;
    transform: translateY(20px);
    opacity: 0;
    animation: toastIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}
@keyframes toastIn {
    to { transform: translateY(0); opacity: 1; }
}

.toast.success {
    border-left-color: #10b981;
}
.toast.success i {
    color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}
.toast.error i {
    color: #ef4444;
}

.toast.info {
    border-left-color: var(--accent-blue);
}
.toast.info i {
    color: var(--accent-blue);
}

/* Custom Confirm Modal Styling */
.confirm-card {
    max-width: 380px;
    border-color: rgba(239, 68, 68, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 
                0 0 30px rgba(239, 68, 68, 0.05);
}

.confirm-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.confirm-icon-glow {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ef4444;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
    animation: confirmPulse 2s infinite ease-in-out;
}

@keyframes confirmPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.25);
    }
}

.confirm-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.confirm-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.confirm-actions .btn {
    flex: 1;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

/* Passcode Login Page Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    padding: 1.5rem;
}

.login-card {
    max-width: 400px;
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: rgba(13, 20, 35, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #000;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.25);
}

.login-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.login-card .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.login-form {
    width: 100%;
}

.login-error-alert {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.btn-block-login {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.login-footer {
    margin-top: 2.2rem;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* Click to View/Preview Styles */
.file-name-link {
    text-decoration: none;
    transition: all 0.2s ease;
}

.file-name-link:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn-action-view {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.btn-action-view:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Responsive Overrides */
@media (max-width: 576px) {
    .app-container {
        padding: 1rem;
    }
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .card {
        padding: 1.25rem;
    }
    .file-table th:nth-child(3), 
    .file-table td:nth-child(3) {
        display: none; /* Hide date on small mobile */
    }
    .modal-card {
        padding: 1.5rem;
    }
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* Theme Selector UI Styling */
.btn-theme-select:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.btn-theme-select.active {
    border-color: var(--accent-cyan) !important;
    background: rgba(0, 242, 254, 0.08) !important;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}
.btn-theme-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Animated Scanning Laser Line for OCR */
@keyframes laser-scan {
    0% { top: 0%; opacity: 0.8; }
    50% { top: 100%; opacity: 0.8; }
    100% { top: 0%; opacity: 0.8; }
}

/* OCR/PDF Scanner modal fullscreen override */
#ocr-scanner-modal.modal-overlay {
    z-index: 2100;
    padding: 0;
    background: #000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#ocr-scanner-modal.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
