/* ================================================================
   Sadbhavna ePaper — Frontend Styles
   सद्भावना आवाज़ ई-पेपर — फ्रंटएंड CSS
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
    --se-red:        #c0392b;
    --se-red-dark:   #922b21;
    --se-orange:     #e67e22;
    --se-bg:         #1a1a2e;
    --se-bg2:        #16213e;
    --se-bg3:        #0f3460;
    --se-surface:    #1e2a45;
    --se-border:     #2d3d5a;
    --se-text:       #e8eaf0;
    --se-text-muted: #8892a4;
    --se-white:      #ffffff;
    --se-gold:       #f1c40f;
    --se-green:      #25D366;
    --se-radius:     8px;
    --se-font:       'Noto Sans Devanagari', 'Mangal', sans-serif;
}

/* ── WRAPPER ── */
.se-epaper-wrap {
    font-family: var(--se-font);
    background: var(--se-bg);
    border: 1px solid var(--se-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* ── HEADER ── */
.se-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(135deg, var(--se-red) 0%, var(--se-red-dark) 100%);
    padding: 14px 20px;
}

.se-header-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.se-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--se-white);
    letter-spacing: -0.5px;
}
.se-logo-sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.se-city-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--se-white);
    font-size: 14px;
}
.se-select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--se-white);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: var(--se-font);
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.se-select option { background: var(--se-red-dark); color: var(--se-white); }

.se-edition-date {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    background: rgba(255,255,255,0.12);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ── TOOLBAR ── */
.se-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--se-bg2);
    padding: 10px 16px;
    border-bottom: 1px solid var(--se-border);
}
.se-toolbar-left,
.se-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.se-btn {
    font-family: var(--se-font);
    background: var(--se-surface);
    border: 1px solid var(--se-border);
    color: var(--se-text);
    padding: 7px 14px;
    border-radius: var(--se-radius);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.se-btn:hover {
    background: var(--se-bg3);
    border-color: var(--se-red);
    color: var(--se-white);
    transform: translateY(-1px);
}
.se-btn:active { transform: translateY(0); }
.se-icon-btn { padding: 7px 10px; }

.se-whatsapp {
    background: var(--se-green) !important;
    border-color: #128C7E !important;
    color: white !important;
}
.se-whatsapp:hover { filter: brightness(1.1); }

.se-page-info {
    color: var(--se-text-muted);
    font-size: 13px;
    padding: 0 6px;
}
.se-page-info strong { color: var(--se-gold); }

/* ── VIEWER STAGE ── */
.se-viewer-stage {
    position: relative;
    background: #0d0d1a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.se-flipbook-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas pages rendered by PDF.js */
.se-flipbook-container canvas {
    display: block;
    max-width: 100%;
}

/* Loading overlay */
.se-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,13,26,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    color: var(--se-text);
    font-size: 15px;
    gap: 16px;
    backdrop-filter: blur(4px);
}
.se-loader {
    width: 48px; height: 48px;
    border: 4px solid var(--se-border);
    border-top-color: var(--se-red);
    border-radius: 50%;
    animation: se-spin .8s linear infinite;
}
@keyframes se-spin { to { transform: rotate(360deg); } }

/* No edition placeholder */
.se-no-edition {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--se-text-muted);
    gap: 12px;
    padding: 40px;
    text-align: center;
}
.se-no-edition-icon { font-size: 64px; }
.se-no-edition h3 { color: var(--se-text); font-size: 20px; margin: 0; }
.se-no-edition p  { margin: 0; font-size: 14px; }

/* ── ARCHIVE SECTION ── */
.se-archive-section {
    background: var(--se-bg2);
    border-top: 1px solid var(--se-border);
    padding: 20px;
}
.se-archive-title {
    color: var(--se-text);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.se-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    overflow-x: auto;
}

.se-archive-card {
    background: var(--se-surface);
    border: 1px solid var(--se-border);
    border-radius: var(--se-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.se-archive-card:hover {
    border-color: var(--se-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(192,57,43,0.3);
}
.se-archive-card.se-active {
    border-color: var(--se-gold);
    box-shadow: 0 0 0 2px var(--se-gold);
}
.se-archive-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}
.se-archive-thumb-placeholder {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--se-bg3);
}
.se-archive-date {
    display: block;
    font-size: 11px;
    color: var(--se-text-muted);
    padding: 6px 4px;
    line-height: 1.3;
}

/* ── FULLSCREEN MODE ── */
.se-epaper-wrap.se-fullscreen-mode {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
}
.se-epaper-wrap.se-fullscreen-mode .se-viewer-stage {
    height: calc(100vh - 130px) !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .se-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .se-toolbar { flex-direction: column; align-items: stretch; }
    .se-toolbar-left, .se-toolbar-right { justify-content: center; flex-wrap: wrap; }
    .se-archive-grid { grid-template-columns: repeat(auto-fill, minmax(80px,1fr)); }
    .se-logo-text { font-size: 18px; }
    .se-btn { font-size: 12px; padding: 6px 10px; }
}
@media (max-width: 480px) {
    .se-archive-grid { grid-template-columns: repeat(3,1fr); }
}
