@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Manrope:wght@200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Manrope:wght@200..800&display=swap');
:root {
    --bg:           #ffffff;
    --bg-secondary: #f5f5f5;
    --nav-bg:       #F9F9F9;
    --nav-border:   #EEEEEE;
    --text:         #1a1a1a;
    --text-muted:   #555;
    --text-faint:   #aaa;
    --card-bg:      #e8e8e8;
    --placeholder:  linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    --footer-border:#ebebeb;
    --section-title:#1a1a1a;
    --card-title:   #333;
    --modal-bg:     #ffffff;
    --toggle-track: #e0e0e0;
    --toggle-thumb: #ffffff;
    --toggle-active:#2F7041;
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
    --bg:           #0C1014;
    --bg-secondary: #161616;
    --nav-bg:       #0C1014;
    --nav-border:   #2a2a2a;
    --text:         #f0f0f0;
    --text-muted:   #aaaaaa;
    --text-faint:   #666;
    --card-bg:      #1e1e1e;
    --placeholder:  linear-gradient(135deg, #1a3525 0%, #1f4d30 100%);
    --footer-border:#2a2a2a;
    --section-title:#f0f0f0;
    --card-title:   #cccccc;
    --modal-bg:     #1a1a1a;
    --toggle-track: #2F7041;
    --toggle-thumb: #0d0d0d;
    --toggle-active:#2F7041;
}

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

body {
    font-family: "Manrope", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

.page-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: clip;
}

/* TOP NAV */
.top-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s, border-color 0.3s;
}
.top-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 7px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.brand-leaf { width: 28px; height: auto; }
.brand-name {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #2F7041;
    letter-spacing: -0.3px;
}
.login-btn {
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #2F7041;
    text-decoration: none;
    padding: 7px 18px;
    border: 1.5px solid #2F7041;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}
.login-btn:hover { background: #2F7041; color: #fff; }

/* THEME TOGGLE BUTTON (image-based) */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.theme-label {
    white-space: nowrap;
    transition: color 0.3s;
    font-family: 'Manrope';
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0px;
    vertical-align: middle;
    background: linear-gradient(180deg, #477533 0%, #154102 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .theme-label {
    background: linear-gradient(180deg, #FFFFFF 0%, #E7E7E7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.theme-toggle-img {
    width: auto;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s;
    border-radius: 100px;
}
.theme-toggle:hover .theme-toggle-img {
    transform: scale(1.06);
    opacity: 0.9;
}

/* HERO HEADER */
.beejily-top-header {
    background-image: url("../img/beejily-top-header.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
    padding-bottom: 0;
}
.header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.main-title {
    font-family: 'Be Vietnam Pro';
    font-weight: 800;
    font-size: 40px;
    letter-spacing: 0.4px;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;
    color: #303030;
}
[data-theme="dark"] .main-title {
    color: #F5F5F5;
}

/* TAGS SWIPER & CATEGORY SUBTAGS */ 
.tags-swiper, .subcategories-swiper { 
    width: 100%; 
    overflow: hidden;
    padding: 14px 0 12px !important;
}  
.tag-slide {
    width: auto !important;
}

/* Category Page Specific */
.category-description {
    margin-top: -10px;
    margin-bottom: 8px;
    text-align: left;
    font-family: 'Manrope';
    font-weight: 500;
    font-size: 14px;
    line-height: 22px; 
    letter-spacing: 0px;
    text-transform: capitalize;
    color: #404040;
}
[data-theme="dark"] .category-description {
    color: #F5F5F5;
    opacity: 0.8; 
}
.reels-grid {
    display: grid;
    grid-template-columns: repeat(5, 242px);
    gap: 0;
    max-width: 1210px;
    border-radius: 12px;
    overflow: hidden;
    isolation: isolate;
}
.reels-grid.not-fitted {
    border-radius: 0 !important;
}
.reels-grid .reel-card-img-wrap {
    border-radius: 0;
    width: 242px;
    height: 346px;
}
.reels-grid .card-overlay {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 43.64%, rgba(0, 0, 0, 0.68) 100%);
}

/* CATEGORY TAGS BAR */
.tags-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}
.tags-bar::-webkit-scrollbar { display: none; }
.tag {
    flex-shrink: 0;
    background: #E7EAEE;
    color: #000000;
    padding: 8px 15px;
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    font-family: 'Manrope';
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0px;
    text-transform: capitalize;
}
.tag:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}
.tag.active {
    background: #1a3d22;
    color: #F5F5F5;
    border-color: #1a3d22;
    box-shadow: 0 2px 8px rgba(47,112,65,0.3);
}
/* Dark mode tags */
[data-theme="dark"] .tag {
    background: #25292E;
    color: #F5F5F5; 
    border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .tag:hover {
    background: #2a2a2a;
}
[data-theme="dark"] .tag.active {
    background: #2F7041;
    color: #ffffff;
    border-color: #2F7041;
}
/* Post count inside tag */
.tag-count {
    font-size: 14px;
    font-weight: 500;
    margin-left: 2px;
    color: #616161;
}
[data-theme="dark"] .tag-count {
    color: #A8A89C;
}

/* TREE IMAGES */
.tree-img { position: absolute; bottom: 0; }
.tree-img.desktop { right: 0; width: 220px; }
.tree-img.mobile  { display: none; }

/* OVERALL BACKGROUND */
.overall-background {
    background-image: url("../img/overall-background.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
[data-theme="dark"] .overall-background {
    background-image: none;
    background: var(--bg);
}

/* MAIN CONTAINER */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* REEL SECTIONS */
.reel-section {
    padding-top: 36px;
    padding-bottom: 2rem;
    position: relative;
    z-index: 9;
    scroll-margin-top: 80px;
}
.section-title {
    margin-bottom: 30px;
    transition: color 0.3s;
    font-family: 'Manrope';
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 0px;
    text-transform: capitalize;
    color: #3B3B3B;
}
[data-theme="dark"] .section-title {
    color: #F5F5F5;
}

/* REELS SWIPER */
.reels-swiper {
    width: 100%;
    overflow: visible;
    padding-bottom: 12px;
}
.reels-swiper .reel-card {
    width: 166px !important;
    flex-shrink: 0;
}

/* REEL CARD */
.reel-card {
    cursor: pointer;
}
.reel-card-img-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    background: var(--card-bg);
    transition: background 0.3s;
}
.reels-swiper .reel-card-img-wrap {
    width: 166px;
    height: 295px;
    aspect-ratio: auto;
}
.reel-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--placeholder);
    transition: background 0.3s;
}
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
}
.view-count {
    color: #ffffff;
    font-family: 'Manrope';
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0px;
    text-transform: capitalize;
}
.reel-card-title {
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
    font-family: 'Manrope';
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0px;
    text-transform: capitalize;
    color: #1F1F1F;
}
[data-theme="dark"] .reel-card-title {
    color: #E6E6E6;
}

/* FOOTER */
.footer { padding: 32px 0 0; }
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 3rem;
    transition: border-color 0.3s;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 2.5rem;
    padding-top: 24px;
    justify-content: space-between;
}
.footer-links a {
    text-decoration: none;
    transition: color 0.2s;
    font-family: 'Manrope';
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0px;
    text-transform: capitalize;
    color: #4E4E4E;
}
.footer-links a:hover { color: #2F7041; }
.copyright {
    color: #9C9C9C;
    font-family: 'Manrope';
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0px;
    text-transform: capitalize;
    text-align: center;
}
[data-theme="dark"] .footer-links a { color: #B5B5B5; }
[data-theme="dark"] .copyright { color: #B8B8B8; }

/* REEL MODAL */
.reel-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #0F1014; /* Always dark theme */
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.reel-modal-overlay.active { display: flex; }

.reel-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.2s;
}
.reel-modal-close:hover {
    transform: scale(1.1);
}

.reel-modal-layout {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    padding: 0;
    box-sizing: border-box;
}

/* Left Info */
.reel-modal-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 40px 20px;
    color: #fff;
    max-width: 400px;
}
.modal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.modal-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
}
.modal-brand-name {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}
.modal-title-text {
    font-family: "Manrope", sans-serif;
    font-size: 16px;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 8px;
}
.modal-hashtags {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    color: #fff;
    opacity: 0.8;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Center Video */
.reel-modal-center {
    position: relative;
    height: 100vh;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.modal-thumb, .modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.modal-video::-webkit-media-controls {
    display: none !important;
}
.modal-video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Volume Control Capsule (Bottom Right - Before & After Hover) */
.reel-volume-control {
    position: absolute;
    bottom: 24px;
    right: 20px;
    width: 38px;
    height: 38px;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 0;
    box-sizing: border-box;
    z-index: 30;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    user-select: none;
    overflow: hidden;
    transition: height 0.28s cubic-bezier(0.25, 1, 0.5, 1),
                border-radius 0.28s ease,
                padding 0.28s ease,
                background 0.2s ease;
}
.reel-volume-slider-track {
    position: relative;
    width: 6px;
    height: 72px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    cursor: pointer;
    touch-action: none;
    margin-bottom: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.reel-volume-slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 999px;
    pointer-events: none;
}
.reel-volume-slider-thumb {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, 50%);
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: transform 0.1s;
}
.reel-volume-toggle-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.reel-volume-toggle-btn:hover {
    transform: scale(1.15);
}

/* AFTER HOVER (EXPANDED PILL STATE) */
.reel-volume-control:hover,
.reel-volume-control.expanded,
.reel-volume-control.is-dragging {
    height: 134px;
    border-radius: 999px;
    padding: 12px 0 6px;
    background: rgba(30, 30, 30, 0.85);
}
.reel-volume-control:hover .reel-volume-slider-track,
.reel-volume-control.expanded .reel-volume-slider-track,
.reel-volume-control.is-dragging .reel-volume-slider-track {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Right Actions */
.reel-modal-right {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 0 20px 20px;
    gap: 24px;
}
.action-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.modal-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}
.modal-action-btn:hover {
    transform: scale(1.1);
}

/* Nav Arrows */
.reel-nav-arrows {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.nav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #282828;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.nav-arrow:hover {
    background: #3A3A3A;
}

/* Inner Popups (Like / Share) */
.inner-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1A1A20;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    font-family: 'Manrope', sans-serif;
}
.inner-modal.active {
    display: flex;
}
.inner-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}
.inner-modal h3 {
    font-size: 20px;
    margin-bottom: 8px;
}
.inner-modal p {
    font-size: 14px;
    color: #aaa;
    text-align: center;
    margin-bottom: 24px;
}
.inner-modal-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 12px;
}
.inner-modal-btn.primary {
    background: #4C51F7;
    color: #fff;
}
.inner-modal-btn.secondary {
    background: transparent;
    color: #4C51F7;
}
.share-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}
.share-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.share-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* More Options Dropdown */
.more-options-dropdown {
    position: absolute;
    bottom: 40px;
    right: 0;
    background: #cdcdcd;
    border-radius: 12px;
    padding: 8px 0;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    z-index: 10002;
    cursor: default;
}
.more-options-dropdown.show {
    display: flex;
}
.more-option-item {
    padding: 12px 20px;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}
.more-option-item:hover {
    background: #b5b5b5;
}

/* SCROLL TO TOP */
.scroll-to-top {
    position: fixed;
    bottom: 50px;
    right: 70px;
    width: 48px;
    height: 48px;
    background: #2F7041;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}
.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    background: #1a3d22;
    transform: translateY(-3px) scale(1.05);
}
[data-theme="dark"] .scroll-to-top {
    background: #477533;
}
[data-theme="dark"] .scroll-to-top:hover {
    background: #2F7041;
}

/* RESPONSIVE */
@media (max-width: 860px) {
    .tree-img.desktop { width: 150px; }
}
@media (max-width: 600px) {
    .main-title { font-size: 30px; line-height: 33px;}
    .tree-img.desktop { display: none; }
    .tree-img.mobile  { display: block; width: 120px; }
    .reel-modal-content { flex-direction: column; }
    .reel-modal-media   { flex: none; max-width: 100%; max-height: 55vw; }
    .modal-actions      { flex-direction: row; justify-content: space-around; }
}
.custom-swiper-next {
    position: absolute;
    top: 40%;
    right: 4px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-color: transparent !important;
    background-image: url('../img/light-theme-arrow-mobile.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    cursor: pointer;
}
[data-theme="dark"] .custom-swiper-next {
    background-image: url('../img/dark-theme-arrow-mobile.png');
}
@media (min-width: 769px) {
    .custom-swiper-next {
        width: 48px;
        height: 48px;
        background-image: url('../img/light-theme-arrow-desktop.png');
    }
    [data-theme="dark"] .custom-swiper-next {
        background-image: url('../img/dark-theme-arrow-desktop.png');
    }
}
.custom-swiper-next.swiper-button-disabled,
.custom-swiper-next.swiper-button-lock {
    display: none !important;
}

.category-header {
    align-items: flex-start !important;
    text-align: left !important;
}
.category-header .main-title {
    text-align: left !important;
}
