/* ============================================
   OnlyChrist - Pergamino / Cuero Antiguo
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --parchment: #f5f2e6;
    --parchment-dark: #e8e0c8;
    --leather: #8b7355;
    --leather-light: #a08c6e;
    --leather-dark: #6b5740;
    --ink: #1a1a1a;
    --ink-soft: #333333;
    --ink-muted: #666666;
    --gold: #8b6914;
    --gold-accent: #a07d2e;
    --crimson: #7a1a1a;
    --dark-bg: #2c2416;
    --dark-bg-light: #3d3225;
}

/* === FONTS === */
h1, h2, h3, h4, h5, h6,
.navbar-brand {
    font-family: 'Cinzel', 'Georgia', serif !important;
    color: var(--ink);
}

body {
    font-family: 'Crimson Text', 'Georgia', serif;
    font-size: 1.05rem;
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--parchment-dark);
}

main { flex: 1; }

/* === MAIN CONTAINER === */
main.container {
    background: var(--parchment);
    border-left: 2px solid var(--leather-light);
    border-right: 2px solid var(--leather-light);
    box-shadow:
        -6px 0 12px rgba(0,0,0,0.06),
        6px 0 12px rgba(0,0,0,0.06);
    max-width: 1200px;
    position: relative;
}

/* Rolled edges */
main.container::before,
main.container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    z-index: 1;
    pointer-events: none;
}

main.container::before {
    left: -15px;
    background: linear-gradient(to right, transparent, var(--leather-light) 40%, var(--parchment-dark) 70%, var(--parchment));
    border-radius: 6px 0 0 6px;
    box-shadow: -2px 0 6px rgba(0,0,0,0.1);
}

main.container::after {
    right: -15px;
    background: linear-gradient(to left, transparent, var(--leather-light) 40%, var(--parchment-dark) 70%, var(--parchment));
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 0 6px rgba(0,0,0,0.1);
}

/* === NAVBAR === */
.navbar {
    background: #4a3d28 !important;
    border-bottom: 2px solid var(--leather);
}

.navbar-brand {
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #ffffff !important;
    white-space: nowrap;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.95) !important;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.navbar .nav-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.navbar .form-control {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
}

.navbar .form-control::placeholder { color: rgba(255,255,255,0.4); }

.navbar .btn-outline-light {
    border-color: var(--leather-light);
    color: var(--parchment-dark);
}

.navbar .btn-outline-light:hover {
    background: var(--leather);
    color: white;
    border-color: var(--leather);
}

/* === CARDS === */
.card {
    background: #ffffff;
    border: 1px solid var(--parchment-dark);
    border-radius: 3px;
}

.card .card-body {
    background: #ffffff;
}

.card-video {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--parchment-dark);
    border-radius: 3px;
    overflow: hidden;
    background: #ffffff;
}

.card-video:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card-video .card-img-top {
    height: 200px;
    object-fit: cover;
    background-color: var(--dark-bg);
}

.video-placeholder {
    height: 200px;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--leather-light);
    font-size: 3rem;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--leather-dark) !important;
    border-color: var(--leather-dark) !important;
    color: white !important;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--leather) !important;
    border-color: var(--leather) !important;
}

.btn-outline-primary {
    color: var(--leather-dark) !important;
    border-color: var(--leather) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--leather-dark) !important;
    border-color: var(--leather-dark) !important;
    color: white !important;
}

.btn-outline-secondary {
    color: var(--ink-muted) !important;
    border-color: var(--parchment-dark) !important;
}

.btn-outline-danger {
    color: var(--crimson) !important;
    border-color: var(--crimson) !important;
}

/* === LIKE === */
.btn-like {
    border: none;
    background: none;
    color: var(--ink-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-like:hover,
.btn-like.liked {
    color: var(--crimson);
}

/* === CATEGORY PILLS === */
.category-pill {
    padding: 6px 18px;
    border-radius: 2px;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    background: var(--parchment) !important;
    color: var(--ink-soft) !important;
    border: 1px solid var(--parchment-dark);
}

.category-pill:hover,
.category-pill.active {
    background: var(--leather-dark) !important;
    color: white !important;
    border-color: var(--leather-dark);
}

/* === CHANNEL HEADER === */
.channel-header {
    flex-wrap: wrap;
}

/* === AUTH CARD === */
.auth-card {
    max-width: 450px;
    margin: 2rem auto;
    border: 1px solid var(--parchment-dark);
    border-radius: 3px;
    background: var(--parchment);
}

/* === VIDEO PLAYER === */
.video-player {
    background: #000;
    border-radius: 3px;
    overflow: hidden;
}

.video-player video {
    width: 100%;
    max-height: 70vh;
}

/* === FORMS === */
.form-control {
    background: white !important;
    border: 1px solid var(--parchment-dark) !important;
    color: var(--ink) !important;
    font-family: 'Crimson Text', serif;
}

.form-control:focus {
    box-shadow: 0 0 0 2px rgba(139,115,85,0.2) !important;
    border-color: var(--leather-light) !important;
}

.form-check-input:checked {
    background-color: var(--leather-dark);
    border-color: var(--leather-dark);
}

/* === BADGES === */
.badge.bg-primary,
.badge.bg-primary.bg-opacity-10 {
    background: rgba(139,115,85,0.12) !important;
    color: var(--leather-dark) !important;
}

.badge.bg-success { background: #3d6b35 !important; }
.badge.bg-warning { background: var(--leather-light) !important; color: white !important; }
.badge.bg-danger { background: var(--crimson) !important; }

.badge-status { font-size: 0.75rem; }

/* === DROPDOWN === */
.dropdown-menu {
    background: var(--parchment);
    border: 1px solid var(--parchment-dark);
}

.dropdown-item { color: var(--ink); }
.dropdown-item:hover { background: var(--parchment-dark); }

/* === LIST GROUP === */
.list-group-item {
    background: var(--parchment);
    border-color: var(--parchment-dark);
    color: var(--ink);
}

.list-group-item:hover,
.list-group-item-action:hover {
    background: var(--parchment-dark);
}

.list-group-item-light {
    background: rgba(139,115,85,0.06) !important;
}

/* === PAGINATION === */
.page-link {
    background: var(--parchment);
    border-color: var(--parchment-dark);
    color: var(--leather-dark);
    font-family: 'Cinzel', serif;
}

.page-item.active .page-link {
    background: var(--leather-dark);
    border-color: var(--leather-dark);
    color: white;
}

/* === TABLES === */
.table { color: var(--ink); }
.table-light { background: var(--parchment-dark) !important; }
.table-hover tbody tr:hover { background: rgba(139,115,85,0.06); }

/* === ALERTS === */
.alert-info {
    background: rgba(139,115,85,0.08);
    border-color: var(--leather-light);
    color: var(--ink);
}

.alert-warning {
    background: rgba(139,115,85,0.1);
    border-color: var(--leather-light);
    color: var(--ink);
}

/* === FOOTER === */
footer {
    background: var(--dark-bg) !important;
    border-top: 2px solid var(--leather);
    font-family: 'Cinzel', serif;
}

footer p { color: var(--parchment-dark); }

/* === NAV PILLS === */
.nav-pills .nav-link {
    color: var(--ink-soft);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    border-radius: 2px;
}

.nav-pills .nav-link.active {
    background: var(--leather-dark);
    color: white;
}

/* === LINKS === */
a { color: var(--leather-dark); }
a:hover { color: var(--leather); }

/* === TEXT === */
.text-primary { color: var(--leather-dark) !important; }
.text-muted { color: var(--ink-muted) !important; }
.text-dark { color: var(--ink) !important; }
.fw-bold { color: var(--ink); }

/* === MISC === */
.bg-dark { background: var(--dark-bg) !important; }
.bg-light { background: var(--parchment-dark) !important; }
.bg-primary.bg-opacity-10 { background: rgba(139,115,85,0.08) !important; }
.shadow-sm { box-shadow: 1px 1px 6px rgba(0,0,0,0.06) !important; }

blockquote {
    border-left: 2px solid var(--leather);
    padding-left: 1rem;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--parchment-dark); }
::-webkit-scrollbar-thumb { background: var(--leather-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--leather); }

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Tablet (max 992px) --- */
@media (max-width: 992px) {
    /* Navbar search smaller */
    .navbar .mx-auto { max-width: 280px !important; }

    /* Video grid: 2 columns */
    .col-lg-3 { width: 50% !important; }

    /* Channel header: reduce gap */
    .card-body.d-flex.gap-4 { gap: 1rem !important; }
}

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {
    /* Navbar search: full width in collapsed menu */
    .nav-search-container {
        max-width: 100% !important;
        margin: 0.5rem 0 !important;
    }

    /* Remove scroll decorations */
    main.container::before,
    main.container::after { display: none; }

    main.container {
        border-left: none;
        border-right: none;
        padding: 1rem 0.75rem !important;
        box-shadow: none;
    }

    /* Headings */
    h1 { font-size: 1.4rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1.05rem; }
    h5 { font-size: 0.95rem; }
    h6 { font-size: 0.85rem; }

    /* Body font */
    body { font-size: 0.95rem; }

    /* Cards */
    .card-body { padding: 0.75rem !important; }

    /* Auth/form cards full width */
    .auth-card {
        margin: 0.5rem auto !important;
        max-width: 100% !important;
    }
    .auth-card .card-body { padding: 1.25rem !important; }

    /* Video cards */
    .card-video .card-img-top { height: 140px; }
    .video-placeholder { height: 140px !important; font-size: 2rem !important; }
    .card-video .card-body { padding: 0.5rem !important; }
    .card-video .card-body h6 { font-size: 0.8rem; }
    .card-video:hover { transform: none; } /* disable hover lift on touch */

    /* Video grid: 2 columns on mobile */
    .row.g-4 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
    .col-sm-6 { width: 50% !important; }
    .col-md-4 { width: 50% !important; }
    .col-lg-3 { width: 50% !important; }

    /* Channel header: stack vertically */
    .card-body.d-flex.gap-4 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    .card-body.d-flex.gap-4 img,
    .card-body.d-flex.gap-4 > div:first-child {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
    }

    /* Channel filter buttons */
    .btn-group.btn-group-sm { flex-wrap: wrap; }
    .btn-group.btn-group-sm .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    /* Nav pills horizontal scroll */
    .nav-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-pills::-webkit-scrollbar { display: none; }
    .nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
        white-space: nowrap;
    }

    /* Category/filter pills: horizontal scroll */
    .d-flex.flex-wrap.gap-1 {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .d-flex.flex-wrap.gap-1::-webkit-scrollbar { display: none; }

    /* Muro post actions */
    .d-flex.gap-3.pt-2.border-top {
        gap: 0.75rem !important;
        flex-wrap: wrap;
    }
    .d-flex.gap-3.pt-2.border-top .btn-sm,
    .d-flex.gap-3.pt-2.border-top .btn { font-size: 0.8rem; }

    /* Post create form: stack buttons */
    .d-flex.justify-content-between.align-items-center.mt-2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem;
    }
    .d-flex.justify-content-between.align-items-center.mt-2 .d-flex.gap-2 {
        justify-content: center;
    }

    /* Suggested users: smaller */
    .d-flex.gap-3.overflow-auto .text-center { width: 80px !important; }
    .d-flex.gap-3.overflow-auto img { width: 40px !important; height: 40px !important; }

    /* Stream pages */
    .col-lg-8, .col-lg-4 { width: 100% !important; }
    .card[style*="height:500px"] { height: 280px !important; }

    /* Video player */
    .video-player video { max-height: 50vh; }

    /* Video detail: stack info */
    .d-flex.align-items-center.gap-3.mb-3 {
        flex-wrap: wrap;
        gap: 0.4rem !important;
    }

    /* Share buttons */
    .d-flex.gap-2.mt-3,
    .d-flex.gap-2.mt-2 {
        flex-wrap: wrap;
    }

    /* Footer */
    footer { padding: 1rem 0 !important; }
    footer .btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        margin-bottom: 0.25rem;
    }
    footer p { font-size: 0.8rem; }
    footer small { font-size: 0.65rem; }

    /* Profile stats */
    .d-flex.gap-4.mb-4.text-center { gap: 1.5rem !important; }
    .d-flex.gap-4.mb-4.text-center h5 { font-size: 1.1rem; }

    /* List group items */
    .list-group-item { padding: 0.6rem 0.75rem; font-size: 0.9rem; }

    /* Pagination */
    .page-link { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

    /* Forms */
    .form-control { font-size: 0.9rem; }
    .form-control-sm { font-size: 0.8rem; }
    textarea.form-control { min-height: 60px; }

    /* Buttons */
    .btn { font-size: 0.85rem; }
    .btn-sm { font-size: 0.75rem; }
    .btn.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

    /* Alerts */
    .alert { padding: 0.5rem 0.75rem; font-size: 0.85rem; }

    /* Top donors ranking */
    .card-body.d-flex.align-items-center.gap-3.py-3 { gap: 0.75rem !important; }
    .card-body.d-flex.align-items-center.gap-3.py-3 > div:first-child { min-width: 35px; }

    /* Trending section */
    .col-lg-2 { width: 33.33% !important; }

    /* Hero text */
    .lead { font-size: 0.95rem; }
}

/* --- Small Mobile (max 576px) --- */
@media (max-width: 576px) {
    /* Navbar */
    .navbar-brand {
        font-size: 1rem !important;
        letter-spacing: 1px;
    }
    .navbar .form-control {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    .navbar .btn-outline-light {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Main padding */
    main.container { padding: 0.75rem 0.5rem !important; }

    /* Video grid: single column for very small */
    .col-sm-6 { width: 100% !important; }
    .card-video .card-img-top { height: 180px; }
    .video-placeholder { height: 180px !important; }

    /* Trending: 2 per row */
    .col-lg-2 { width: 50% !important; }

    /* Channel: upload button wrap */
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    /* Post form: smaller textarea */
    .form-control.border-0.bg-light[rows="2"] {
        font-size: 0.85rem;
        min-height: 50px;
    }

    /* Post author area */
    .d-flex.align-items-center.gap-2.mb-2 img,
    .d-flex.align-items-center.gap-2.mb-2 > div:first-child {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    /* Forum thread in feed */
    .card[style*="border-left:4px"] .card-body { padding: 0.6rem !important; }
    .card[style*="border-left:4px"] h6 { font-size: 0.85rem; }

    /* Stream chat: even smaller */
    .card[style*="height:500px"] { height: 250px !important; }

    /* Modal */
    .modal-dialog { margin: 0.5rem; }

    /* Don't show text labels on action buttons, just icons */
    .btn-group-sm .btn {
        font-size: 0; /* hide text */
        padding: 0.25rem 0.5rem;
    }
    .btn-group-sm .btn i {
        font-size: 0.8rem;
    }

    /* Muro post actions: compact on small mobile */
    .d-flex.gap-3.pt-2.border-top {
        gap: 0.5rem !important;
    }
    .d-flex.gap-3.pt-2.border-top .btn-sm,
    .d-flex.gap-3.pt-2.border-top .btn {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
    .d-flex.gap-3.pt-2.border-top .text-muted.small {
        font-size: 0.65rem;
    }

    /* Footer compact */
}
