/* ============================================
   img.uztracker.net — Dark Theme Stylesheet
   ============================================ */

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

::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f0f0f;
}
::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px;
}

/* --- Gradient Text --- */
.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Navigation Links --- */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #a1a1aa;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-link:hover {
    color: #fff;
    background: #27272a;
}
.nav-link-accent {
    color: #f59e0b;
}
.nav-link-accent:hover {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d4d4d8;
    background: #27272a;
    border: 1px solid #3f3f46;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover {
    background: #3f3f46;
    border-color: #52525b;
    color: #fff;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* --- Form Inputs --- */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    color: #e4e4e7;
    background: #18181b;
    border: 1px solid #3f3f46;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-input::placeholder {
    color: #52525b;
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.form-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #52525b;
    pointer-events: none;
}

/* --- Checkboxes --- */
.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.375rem;
    border: 2px solid #52525b;
    background: #18181b;
    cursor: pointer;
    accent-color: #3b82f6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.form-checkbox:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* --- Upload Zone --- */
.upload-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #71717a;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.upload-tab:hover {
    color: #a1a1aa;
}
.upload-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.upload-zone {
    border: 2px dashed #3f3f46;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(24, 24, 27, 0.5), rgba(15, 15, 15, 0.5));
    position: relative;
    overflow: hidden;
}
.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.04), transparent 70%);
    pointer-events: none;
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(15, 15, 15, 0.5));
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.08);
}
.upload-zone.drag-over {
    transform: scale(1.01);
}
.upload-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}
.upload-icon-wrap {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.25rem;
    background: rgba(59, 130, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* --- Cards --- */
.card {
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 1rem;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
}
.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #e4e4e7;
}

/* --- Image Cards --- */
.img-card {
    display: block;
    transition: transform 0.2s ease;
}
.img-card:hover {
    transform: translateY(-2px);
}

/* --- Checker background for image preview --- */
.img-checker-bg {
    background-color: #18181b;
    background-image: 
        linear-gradient(45deg, #27272a 25%, transparent 25%),
        linear-gradient(-45deg, #27272a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #27272a 75%),
        linear-gradient(-45deg, transparent 75%, #27272a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* --- Link groups on view page --- */
.link-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.link-label {
    font-size: 0.6875rem;
    color: #a1a1aa;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* --- Copy button animation --- */
.copy-btn.copied {
    color: #22c55e !important;
}
.copy-btn.copied i {
    animation: copyPop 0.3s ease;
}
@keyframes copyPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- Flash messages --- */
.flash-msg {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    animation: flashSlideIn 0.3s ease;
}
.flash-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #86efac;
}
.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.flash-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
@keyframes flashSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- User dropdown --- */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 14rem;
    background: #1e1e22;
    border: 1px solid #3f3f46;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 50;
    overflow: hidden;
    animation: dropdownFade 0.15s ease;
}
.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: #a1a1aa;
    transition: all 0.15s ease;
}
.dropdown-link:hover {
    background: #27272a;
    color: #fff;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #a1a1aa;
    background: #27272a;
    border: 1px solid #3f3f46;
    transition: all 0.2s ease;
    text-decoration: none;
}
.page-link:hover {
    background: #3f3f46;
    color: #fff;
}
.page-link.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}
.page-dots {
    padding: 0 0.25rem;
    color: #52525b;
    font-size: 0.875rem;
}

/* --- Admin Tabs --- */
.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: #71717a;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}
.admin-tab:hover {
    color: #d4d4d8;
}
.admin-tab.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
}

/* --- Admin Table --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.admin-table th {
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
    border-bottom: 1px solid #27272a;
}
.admin-table td {
    padding: 0.625rem 0.75rem;
    color: #a1a1aa;
    border-bottom: 1px solid rgba(39, 39, 42, 0.5);
    vertical-align: middle;
}
.admin-table tbody tr:hover {
    background: rgba(39, 39, 42, 0.3);
}

.admin-select {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: #18181b;
    border: 1px solid #3f3f46;
    color: #a1a1aa;
    outline: none;
    cursor: pointer;
}

/* --- Stat Cards --- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 1rem;
}
.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Password Strength --- */
.password-strength {
    height: 100%;
    border-radius: 9999px;
}
.password-strength.weak { background: #ef4444; width: 25% !important; }
.password-strength.fair { background: #f59e0b; width: 50% !important; }
.password-strength.good { background: #22c55e; width: 75% !important; }
.password-strength.strong { background: #3b82f6; width: 100% !important; }

/* --- File queue item --- */
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.5);
    animation: fileSlideIn 0.2s ease;
}
.file-item .file-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #27272a;
    flex-shrink: 0;
}
.file-item .file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-item .progress-bar {
    height: 3px;
    border-radius: 2px;
    background: #27272a;
    overflow: hidden;
    margin-top: 0.375rem;
}
.file-item .progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    width: 0%;
    transition: width 0.3s ease;
}
.file-item.uploading {
    border-color: rgba(59, 130, 246, 0.3);
}
.file-item.done {
    border-color: rgba(34, 197, 94, 0.3);
}
.file-item.error {
    border-color: rgba(239, 68, 68, 0.3);
}
@keyframes fileSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Auth form --- */
.auth-form {
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 1.25rem;
    padding: 1.75rem;
    backdrop-filter: blur(12px);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .upload-zone-inner {
        padding: 2rem 1rem;
    }
}

/* ============================
   LIGHT THEME
   ============================ */
html:not(.dark) {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --border-color: #d4d4d8;
}

html:not(.dark) body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

html:not(.dark) .bg-surface-950,
html:not(.dark) [class*="bg-surface-950"] { 
    background: var(--bg-primary) !important; 
}
html:not(.dark) .bg-surface-900,
html:not(.dark) [class*="bg-surface-900"] { 
    background: var(--bg-secondary) !important; 
}
html:not(.dark) .bg-surface-800,
html:not(.dark) [class*="bg-surface-800"] { 
    background: var(--bg-tertiary) !important; 
}
html:not(.dark) .bg-surface-700 {
    background: #d4d4d8 !important;
}

html:not(.dark) .text-white { color: var(--text-primary) !important; }
html:not(.dark) .text-surface-200 { color: var(--text-primary) !important; }
html:not(.dark) .text-surface-300 { color: var(--text-secondary) !important; }
html:not(.dark) .text-surface-400 { color: var(--text-muted) !important; }
html:not(.dark) .text-surface-500 { color: #a1a1aa !important; }

html:not(.dark) .border-surface-800,
html:not(.dark) [class*="border-surface-800"] { 
    border-color: var(--border-color) !important; 
}
html:not(.dark) .border-surface-700,
html:not(.dark) [class*="border-surface-700"] { 
    border-color: #d4d4d8 !important; 
}

html:not(.dark) .noise-overlay { display: none !important; }

html:not(.dark) header {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .form-input,
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
    background: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html:not(.dark) .form-input:focus {
    border-color: #3b82f6 !important;
}

html:not(.dark) .upload-zone {
    background: linear-gradient(135deg, rgba(244, 244, 245, 0.8), rgba(255, 255, 255, 0.8)) !important;
    border-color: #d4d4d8 !important;
}
html:not(.dark) .upload-zone:hover {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.5), rgba(255, 255, 255, 0.8)) !important;
    border-color: #3b82f6 !important;
}

html:not(.dark) .nav-link {
    color: var(--text-secondary) !important;
}
html:not(.dark) .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .img-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .auth-form {
    background: rgba(244, 244, 245, 0.9) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .stat-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .admin-tab {
    color: var(--text-secondary) !important;
}
html:not(.dark) .admin-tab:hover,
html:not(.dark) .admin-tab.active {
    color: #3b82f6 !important;
}

html:not(.dark) .user-dropdown {
    background: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .btn-secondary {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html:not(.dark) .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark) footer {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

html:not(.dark) .result-card,
html:not(.dark) .link-group {
    background: var(--bg-tertiary) !important;
}
