:root {
    /* Bold, Vibrant Dark Theme variables */
    --bg-main: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --border-color: #27272a;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    /* Vibrant gradients for primary elements */
    --accent: #e11d48;
    /* Rich Red */
    --accent-hover: #be123c;
    --accent-light: rgba(225, 29, 72, 0.15);

    --brand-gradient: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.8);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.8), 0 2px 4px -2px rgb(0 0 0 / 0.8);
    --shadow-glow: 0 0 15px rgba(225, 29, 72, 0.35);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.1) 0, transparent 40%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0, transparent 40%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* -----------------------------
   WELCOME PAGE STYLES
----------------------------- */
.welcome-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-container {
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-title .highlight {
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(236, 72, 153, 0.5);
}

.btn-icon-right {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon-right {
    transform: translateX(4px);
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* -----------------------------
   APP PAGE STYLES (MPA)
----------------------------- */

/* Header & Breadcrumbs */
.header {
    padding: 24px 0;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    padding: 16px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.breadcrumb-item:hover {
    color: var(--text-primary);
}

.breadcrumb-item.active {
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    pointer-events: none;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 12px;
    user-select: none;
}

/* Ad Header inside App */
.app-ad-header {
    margin-bottom: 24px;
    width: 100%;
    height: 90px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Main Content */
.main-content {
    position: relative;
    min-height: 400px;
}

.hidden {
    display: none !important;
}

/* Grid System */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Multi-page Navigation Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    background: var(--bg-surface-hover);
}

.card-icon {
    background: var(--accent-light);
    color: var(--accent);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* File List (Stylized Table) */
.file-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(24, 24, 27, 0.5);
    /* subtle transparency */
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--bg-surface-hover);
    padding-left: 28px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.file-name {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
}

.file-meta {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 150px;
    justify-content: flex-end;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loader */
.loader {
    display: none;
    padding: 60px;
    text-align: center;
}

.loader.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Viewer Modal */
.viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.viewer-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.viewer-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1600px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.viewer-modal:not(.hidden) .viewer-content {
    transform: scale(1) translateY(0);
}

.viewer-header {
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-close {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.viewer-body {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-body iframe,
.viewer-body object {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.panzoom-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    transform-origin: center center;
    cursor: grab;
    transition: cursor 0.2s;
}

.panzoom-container:active {
    cursor: grabbing;
}

.panzoom-container img,
.panzoom-container canvas {
    max-width: none !important;
    max-height: none !important;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius);
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(220, 38, 38, 0.3);
    font-size: 15px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Responsive Ads */
.ad-desktop { display: block; }
.ad-mobile { display: none; }
@media (max-width: 768px) {
  .ad-desktop { display: none; }
  .ad-mobile { display: block; }
}

@media (max-width: 600px) {
    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    .viewer-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .viewer-header h2 {
        font-size: 15px;
    }
}\n