/**
 * Simple Secure File Share - Styles
 * 
 * CSS Variables for Light/Dark theme support
 */

/* ============================================
   CSS Variables (Theme Tokens)
   ============================================ */

:root {
    /* Light Theme (Default) */
    --color-bg-primary: #f9fafb;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f3f4f6;
    --color-bg-hover: #e5e7eb;
    
    --color-text-primary: #1f2937;
    --color-text-secondary: #4b5563;
    --color-text-tertiary: #6b7280;
    --color-text-muted: #9ca3af;
    
    --color-border: #e5e7eb;
    --color-border-focus: #3b82f6;
    
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-accent-light: #eff6ff;
    
    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-bg: #fffbeb;
    --color-error: #ef4444;
    --color-error-bg: #fef2f2;
    
    --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);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg-primary: #111827;
    --color-bg-secondary: #1f2937;
    --color-bg-tertiary: #374151;
    --color-bg-hover: #4b5563;
    
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-text-muted: #6b7280;
    
    --color-border: #374151;
    --color-border-focus: #60a5fa;
    
    --color-accent: #60a5fa;
    --color-accent-hover: #3b82f6;
    --color-accent-light: #1e3a5f;
    
    --color-success: #34d399;
    --color-success-bg: #064e3b;
    --color-warning: #fbbf24;
    --color-warning-bg: #78350f;
    --color-error: #f87171;
    --color-error-bg: #7f1d1d;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* ============================================
   Base Styles
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    /* No transition on body to prevent flash */
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   Layout
   ============================================ */

.container {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.min-h-screen {
    min-height: 100vh;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, #4f46e5 100%);
    color: white;
}

.card-body {
    padding: 1.5rem 2rem;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--color-text-primary);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.2);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* Password mask */
.password-masked {
    -webkit-text-security: disc;
    text-security: disc;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    color: white;
    background-color: var(--color-accent);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    color: var(--color-text-primary);
    background-color: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-bg-hover);
}

.btn-danger {
    color: white;
    background-color: var(--color-error);
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-success {
    color: white;
    background-color: var(--color-success);
}

.btn-dark {
    color: white;
    background-color: #1f2937;
}

.btn-dark:hover:not(:disabled) {
    background-color: #111827;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* ============================================
   Drop Zone
   ============================================ */

.drop-zone {
    position: relative;
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover {
    border-color: var(--color-accent);
    background-color: var(--color-accent-light);
}

.drop-zone.drag-over {
    border-color: var(--color-accent);
    background-color: var(--color-accent-light);
    transform: scale(1.01);
}

.drop-zone-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--color-text-muted);
}

.drop-zone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ============================================
   File List
   ============================================ */

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    color: var(--color-text-muted);
}

.file-name {
    font-weight: 500;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.file-remove {
    flex-shrink: 0;
    padding: 0.5rem;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.file-remove:hover {
    color: var(--color-error);
    background-color: var(--color-error-bg);
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-wrapper {
    margin-top: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 0.625rem;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #4f46e5);
    border-radius: var(--radius-full);
    transition: width 0.2s;
}

/* ============================================
   Table
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    margin: auto;
    padding: 0rem;
}

.table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    background-color: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.table tbody tr:hover {
    background-color: var(--color-bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-success {
    color: var(--color-success);
    background-color: var(--color-success-bg);
}

.badge-warning {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
}

.badge-error {
    color: var(--color-error);
    background-color: var(--color-error-bg);
}

.badge-muted {
    color: var(--color-text-tertiary);
    background-color: var(--color-bg-tertiary);
}

.badge-accent {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* ============================================
   Toast Notification
   ============================================ */

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-weight: 600;
    color: white;
    background-color: #1f2937;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 99999;
    animation: toast-in 0.3s ease-out forwards;
}

.toast.hiding {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    text-align: center;
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: var(--radius-full);
}

.modal-icon.success {
    color: var(--color-success);
    background-color: var(--color-success-bg);
}

.modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.modal-message {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ============================================
   Theme Toggle
   ============================================ */

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    color: var(--color-text-primary);
}

.theme-toggle-btn.active {
    color: var(--color-accent);
    background-color: var(--color-bg-secondary);
}

/* ============================================
   Header / Navigation
   ============================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.header-logo svg {
    width: 2rem;
    height: 2rem;
    color: var(--color-accent);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--color-text-primary);
    background-color: var(--color-bg-tertiary);
    text-decoration: none;
}

.nav-link.active {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* ============================================
   Alert Boxes
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-error {
    color: var(--color-error);
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error);
}

.alert-success {
    color: var(--color-success);
    background-color: var(--color-success-bg);
    border: 1px solid var(--color-success);
}

.alert-warning {
    color: var(--color-warning);
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Share Page Specific
   ============================================ */

.share-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, #4f46e5 100%);
    color: white;
}

.share-header-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0.25rem 0 0;
}

.share-header-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.share-header-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.share-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.share-header-icon svg {
    width: 2rem;
    height: 2rem;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .card-header,
    .card-body {
        padding: 1rem 1.25rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-wrapper {
        margin: -1rem;
        padding: 0 1rem;
    }
    
    .btn-block-mobile {
        width: 100%;
    }
}

/* Popup Notification */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.popup-content {
    background: var(--color-bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--color-border);
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

/* Active popup (display:flex instead of none) */
.popup-overlay.active {
    display: flex !important;
}

.popup-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.popup-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.popup-message {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ============================================
   JS UI Styles
   ============================================ */

.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sortable:hover {
    color: var(--color-primary);
}

.sort-icon {
    font-size: 0.8em;
    margin-left: 0.2rem;
}

#list-controls {
    display: none; /* Toggled by JS */
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#list-controls input, 
#list-controls select {
    margin: 0;
}

/* Edit Modal File List */
#edit-file-list button {
    opacity: 0.7;
    transition: opacity 0.2s;
}
#edit-file-list button:hover {
    opacity: 1;
}

/* Mobile Action Bar */
.mobile-only-flex {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only-flex {
        display: flex !important;
    }
    
    #list-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #list-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #share-search {
        width: 100%;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.border-b { border-bottom-width: 1px; border-style: solid; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-16 { top: 4rem; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.bg-white { background-color: white; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Responsive Utilities */
@media (min-width: 768px) {
    .md\:flex { display: flex !important; }
    .md\:hidden { display: none !important; }
}

@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
}

/* ============================================
   Mobile Table Scroll Fix
   ============================================ */
/* Table wrapper for horizontal scroll (card-header stays fixed) */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: 700px;
}

/* Table Column Utilities */
.table .col-id {
    text-align: center;
    font-family: monospace;
    font-size: 0.75rem;
    width: 60px;
}

.table .col-status {
    text-align: center;
    width: 80px;
}

.table .col-center {
    text-align: center;
}

/* ============================================
   Text Truncation (File names, etc)
   ============================================ */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

/* Table cell truncation on mobile */
@media (max-width: 767px) {
    /* Remove table-wrapper negative margin that was causing issues */
    .table-wrapper {
        margin: 0;
        padding: 0 0 1rem 0;
        border-radius: 0;
    }
    
    /* Card should have bottom radius removed to blend with table */
    .card {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    /* Title column wraps */
    .table td:nth-child(2) {
        max-width: none;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Date column shows full */
    .table td:nth-child(6) {
        white-space: nowrap;
        max-width: none;
    }
    
    /* Actions column doesn't truncate */
    .table td:last-child {
        max-width: none;
        overflow: visible;
    }
    
    /* First column (ID) stays small */
    .table td:first-child {
        max-width: 40px;
        white-space: nowrap;
    }
    
    /* Add bottom padding to last row */
    .table tbody tr:last-child td {
        padding-bottom: 1rem;
    }
}

/* ============================================
   Step Box Dark Mode Fix (howto.php)
   ============================================ */
[data-theme="dark"] .step-box {
    background: var(--color-bg-tertiary) !important;
}

[data-theme="dark"] .step-box li {
    color: var(--color-text-secondary);
}

/* Purple step box specific fix for dark mode */
[data-theme="dark"] .step-box[style*="#faf5ff"] {
    background: rgba(168, 85, 247, 0.1) !important;
}

/* File list item truncation */
.file-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

@media (max-width: 767px) {
    .file-item-name {
        max-width: 150px;
    }
}

/* ============================================
   Password field masking and visibility toggle
   ============================================ */
.password-masked {
    -webkit-text-security: disc;
    text-security: disc;
}

.password-visible {
    -webkit-text-security: none;
    text-security: none;
}

/* ============================================
   Dark Mode - Success Modal URL fix
   ============================================ */
[data-theme="dark"] .popup-content input[type="text"],
[data-theme="dark"] .popup-content input[readonly] {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

/* Improve button contrast in modals */
[data-theme="dark"] .popup-content .btn-secondary {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .popup-content .btn-secondary:hover {
    background: var(--color-bg-secondary);
}
