/* ============================================================
   Mono Food - 2026 Katalog Styles
   Logo renkleri: #003088 (mavi), #0f1822 (koyu lacivert)
   Renkler theme-config.js tarafından yönetilir
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fallback değerler - theme-config.js yüklenmezse devreye girer */
:root {
    --teal:        #003088;
    --teal-dark:   #002266;
    --teal-darker: #001844;
    --teal-light:  #2654a8;
    --teal-pale:   #e0e8f5;
    --bg-primary:  #0f1822;
    --bg-surface:  #162030;
    --bg-elevated: #1e2a3e;
    --text-primary:   #e4e8f0;
    --text-secondary: #8898b8;
    --text-on-teal:   #ffffff;
    --accent:       #003088;
    --accent-hover: #2654a8;
    --brand-subtle:       rgba(0, 48, 136, 0.06);
    --brand-subtle-hover: rgba(0, 48, 136, 0.14);
    --brand-glow:         rgba(0, 48, 136, 0.18);
    --brand-overlay:      rgba(0, 48, 136, 0.22);
    --brand-focus:        rgba(0, 48, 136, 0.28);
    --brand-shadow:       rgba(0, 48, 136, 0.4);
    --panel-bg:           rgba(15, 24, 34, 0.94);
    --nav-btn-bg:         rgba(30, 42, 62, 0.88);
    --shadow-dark:        rgba(0, 0, 0, 0.3);
    --shadow-deep:        rgba(0, 0, 0, 0.4);
    --shadow-flip:        rgba(0, 0, 0, 0.45);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --radius: 12px;
    --toolbar-h: 52px;
    --thumb-h: 80px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Screen Management ===== */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}
.screen.active {
    display: flex;
}

/* ===== Upload Screen ===== */
#upload-screen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--bg-primary) 0%, var(--bg-surface) 50%, var(--bg-elevated) 100%);
}

.upload-container {
    text-align: center;
    max-width: 460px;
    width: 90%;
}

.upload-logo {
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.upload-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    line-height: 1.2;
    text-transform: uppercase;
}
.upload-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    letter-spacing: 1px;
}

.upload-area {
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 40px 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--brand-subtle);
}
.upload-area:hover,
.upload-area:focus-visible,
.upload-area.dragover {
    border-color: var(--accent-hover);
    background: var(--brand-subtle-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--brand-glow);
}

.upload-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.upload-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== Loading Screen ===== */
#loading-screen {
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    flex-direction: column;
}

.loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-logo {
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--brand-focus);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 240px;
    height: 6px;
    background: var(--brand-overlay);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--teal-dark), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ===== Toolbar ===== */
.toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-h);
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
    box-shadow: 0 1px 8px var(--shadow-dark);
}

.toolbar-left {
    display: flex;
    align-items: center;
}
.toolbar-logo {
    border-radius: 6px;
}

.toolbar-center {
    flex: 1;
    text-align: center;
}
.toolbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
    letter-spacing: 0.5px;
}
.page-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.toolbar-right {
    display: flex;
    gap: 4px;
}

.tool-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.tool-btn:hover {
    background: var(--brand-overlay);
}

/* ===== Flipbook Viewport ===== */
#flipbook-screen {
    flex-direction: column;
    background: var(--bg-primary);
}

.flipbook-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--toolbar-h);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.flipbook-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#book-container {
    width: 100%;
    height: 100%;
}

.stf__wrapper {
    margin: 0 auto !important;
}

.page-blank {
    background: var(--bg-primary) !important;
}

.flipbook-stage .page-content {
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flipbook-stage .page-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.stf__wrapper {
    box-shadow: 0 0 30px var(--shadow-flip) !important;
}

/* ===== Nav Buttons ===== */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-btn-bg);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 50;
    box-shadow: 0 2px 8px var(--shadow-dark);
}
.nav-btn:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.08);
}
.nav-prev { left: 12px; }
.nav-next { right: 12px; }

/* ===== Thumbnail Strip ===== */
.thumbnail-strip {
    height: var(--thumb-h);
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}
.thumbnail-strip::-webkit-scrollbar {
    height: 3px;
}
.thumbnail-strip::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.thumb-item {
    flex-shrink: 0;
    width: 44px;
    height: 62px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #fff;
}
.thumb-item:hover {
    border-color: var(--teal-light);
}
.thumb-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--brand-shadow);
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* ===== Responsive / Mobile ===== */
@media (max-width: 768px) {
    :root {
        --toolbar-h: 44px;
        --thumb-h: 56px;
    }

    .upload-logo { width: 120px; height: 120px; }
    .upload-title { font-size: 1.6rem; }
    .upload-area { padding: 28px 16px; }

    .nav-btn {
        width: 36px;
        height: 36px;
    }
    .nav-prev { left: 6px; }
    .nav-next { right: 6px; }

    .thumb-item { width: 36px; height: 50px; }

    .toolbar-title { font-size: 0.85rem; }
    .toolbar-logo { width: 30px; height: 30px; }
}

@media (max-width: 480px) {
    .nav-btn {
        width: 32px;
        height: 32px;
        opacity: 0.7;
    }
    .nav-prev { left: 4px; }
    .nav-next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
