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

:root {
    --blue: #1687bd;
    --dark: #12658e;
    --pale: #d9f0f9;
    --border: #c8d5dc;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: auto;
}

body {
    margin: 0;
    background: #f1f3f4;
    color: #222;
    font-family: 'Hind Siliguri', Arial, sans-serif;
}

/* Header */
.top-header {
    width: 100%;
    max-width: 1180px;
    margin: 16px auto 0;
    height: 78px;
    background: linear-gradient(110deg, #31b5e8, #b8eafa, #38aeda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-radius: 5px 5px 0 0;
}

.social {
    display: flex;
    gap: 9px;
}

.social a {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #176b9f;
    color: white;
    text-decoration: none;
    text-align: center;
    line-height: 26px;
    font-weight: bold;
}

.brand {
    text-decoration: none;
    color: #111;
    text-align: center;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-kicker {
    font-size: 12px;
}

.brand strong {
    font-size: 30px;
    letter-spacing: -1px;
}

.brand small {
    font-size: 10px;
}

/* Navigation */
.main-nav {
    width: 100%;
    max-width: 1180px;
    margin: auto;
    background: #54b6d9;
    display: flex;
    gap: 5px;
    padding: 6px 10px;
    overflow: auto;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    white-space: nowrap;
    font-size: 14px;
}

.main-nav a.active,
.main-nav a:hover {
    background: #1677a7;
    border-radius: 3px;
}

/* Three-column layout */
.layout {
    width: 100%;
    max-width: 1180px;
    margin: auto;
    background: #fff;
    padding: 14px 12px;
    display: grid;
    grid-template-columns: 175px minmax(0, 1fr) 205px;
    gap: 12px;
    align-items: start;
    min-height: 650px;
}

.side-heading {
    background: #087caf;
    color: white;
    text-align: center;
    padding: 6px;
    font-size: 15px;
}

.thumbnail-list {
    height: 360px;
    overflow: auto;
    border: 1px solid #8eb8ca;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thumb {
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 5px;
    cursor: pointer;
    color: #333;
}

.thumb canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: auto;
}

.thumb span {
    display: block;
    font-size: 12px;
}

.thumb.active {
    border: 2px solid #1687bd;
    background: #e4f5fc;
}

/* Advertisement */
.ad-placeholder,
.ad-box {
    display: flex;
    min-height: 105px;
    margin-top: 10px;
    background: #d71920;
    color: white;
    text-align: center;
    text-decoration: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.ad-placeholder b {
    font-size: 20px;
}

.ad-placeholder span {
    font-size: 12px;
}

.ad-placeholder small {
    margin-top: 8px;
    background: #eee;
    color: #1474a5;
    padding: 5px 10px;
}

.ad-box {
    padding: 0;
    background: #eee;
}

.ad-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* Page navigation */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}

.pager button,
.pager #page-buttons button {
    border: 0;
    background: #2687c0;
    color: white;
    padding: 5px 9px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.pager #page-buttons {
    display: flex;
    gap: 5px;
}

.pager button.selected,
.pager #page-buttons button.selected {
    background: #064c78;
}

/* Paper viewer */
.paper-card {
    border: 1px solid #ddd;
    border-radius: 9px;
    box-shadow: 0 1px 6px #aaa;
    padding: 12px 12px 10px;
    min-height: 560px;
}

.paper-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 0 4px 8px;
    margin-bottom: 8px;
    font-weight: 600;
}

.paper-title small {
    color: #777;
}

.viewer-tools {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.viewer-tools button,
.viewer-tools a,
.bottom-pager button {
    border: 0;
    background: #187cad;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.viewer-tools span {
    font-size: 12px;
}

.canvas-wrap {
    width: 100%;
    overflow: auto;
    text-align: center;
    background: #f7f7f7;
    min-height: 300px;
}

.canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 1px 5px #aaa;
    background: white;
}

.bottom-pager {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

/* Right column */
.popular-list {
    border: 1px solid #9abac9;
    max-height: 230px;
    overflow: auto;
}

.popular-list button {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 0;
    border-bottom: 1px solid #ddd;
    padding: 7px 9px;
    font: inherit;
    cursor: pointer;
}

.popular-list button:hover {
    background: #e7f5fb;
}

.calendar-box {
    border: 1px solid #7caec5;
    margin-top: 10px;
    padding: 9px;
}

.calendar-box h3 {
    margin: -9px -9px 9px;
    background: #167cac;
    color: white;
    text-align: center;
    padding: 6px;
    font-size: 15px;
}

.calendar-box label {
    display: block;
    font-size: 12px;
}

.calendar-box input {
    width: 100%;
    padding: 7px;
    border: 1px solid #bbb;
}

.calendar-box > button {
    width: 100%;
    margin-top: 6px;
    background: #167cac;
    color: #fff;
    border: 0;
    padding: 7px;
    cursor: pointer;
}

.archive-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    max-height: 220px;
    overflow: auto;
}

.archive-links a {
    font-size: 12px;
    color: #12658e;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

/* Footer */
footer {
    width: 100%;
    max-width: 1180px;
    margin: auto;
    background: #d4edf7;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    font-size: 13px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    font-size: 22px;
}

.footer-brand small {
    font-size: 11px;
}

.copyright {
    background: #4eafd5;
    color: white;
    padding: 8px 14px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

.copyright a {
    color: white;
}

/* Other elements */
.empty-state {
    text-align: center;
    padding: 70px 10px;
    color: #666;
}

.loading {
    padding: 15px;
    text-align: center;
    color: #777;
}

.install-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #edf4f7;
    padding: 20px;
}

.install-card {
    background: white;
    width: min(480px, 100%);
    padding: 28px;
    border-radius: 10px;
    box-shadow: 0 4px 24px #0001;
}

.install-card h1 {
    margin-top: 0;
}

.install-card form,
.admin-card form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.install-card label,
.admin-card label {
    font-weight: 600;
    margin-top: 8px;
}

.install-card input,
.admin-card input {
    padding: 11px;
    border: 1px solid #ccd5da;
    border-radius: 5px;
    font: inherit;
}

.install-card button,
.admin-card button {
    padding: 11px;
    background: #087caf;
    color: white;
    border: 0;
    border-radius: 5px;
    font: inherit;
    cursor: pointer;
    margin-top: 12px;
}

.alert {
    background: #ffe5e5;
    color: #a00;
    padding: 10px;
    margin: 10px 0;
}

.success {
    color: green;
}

.admin-top {
    background: #075f8b;
    color: white;
    padding: 15px 4%;
    display: flex;
    justify-content: space-between;
}

.admin-top a {
    color: white;
    margin-left: 15px;
}

.admin-wrap {
    max-width: 1100px;
    margin: 25px auto;
    padding: 0 15px;
}

.admin-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 18px 0;
}

.admin-card h2 {
    margin-top: 0;
}

.hint {
    color: #666;
    font-size: 13px;
}

.table-scroll {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.danger-link {
    color: #b00;
}

.admin-page {
    background: #f3f6f8;
}

.inline-delete {
    display: inline;
}

.inline-delete button {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

/* মোবাইলেও কম্পিউটারের মতো একই ডিজাইন */
@media screen and (max-width: 1180px) {

    html,
    body {
        min-width: 1180px !important;
        width: 1180px !important;
        overflow-x: auto !important;
    }

    .top-header,
    .main-nav,
    .layout,
    footer {
        width: 1180px !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .top-header {
        height: 78px !important;
        padding: 0 22px !important;
    }

    .brand strong {
        font-size: 30px !important;
    }

    .social {
        gap: 9px !important;
    }

    .social a {
        width: 26px !important;
        height: 26px !important;
        line-height: 26px !important;
        font-size: 14px !important;
    }

    .layout {
        display: grid !important;
        grid-template-columns: 175px minmax(0, 1fr) 205px !important;
        gap: 12px !important;
        padding: 14px 12px !important;
    }

    .left-column,
    .center-column,
    .right-column {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        grid-column: auto !important;
        order: initial !important;
    }

    .right-column {
        grid-template-columns: none !important;
    }

    .thumbnail-list {
        height: 360px !important;
        flex-direction: column !important;
    }

    .thumb {
        min-width: 0 !important;
    }

    .left-column .ad-placeholder,
    .left-column .ad-box {
        display: flex !important;
    }

    .paper-card {
        padding: 12px 12px 10px !important;
    }

    .footer-inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        padding: 20px !important;
    }

    .footer-inner > * {
        margin: 0 !important;
    }
}
