/* Global Vars for App Theme */
:root {
    --app-bg: #000000;
    --app-white: #ffffff;
    --app-grey: #888888;
    --app-dark-grey: #333333;
    --app-primary: linear-gradient(to right, #00f2ea, #ff0050);
}

body {
    background-color: var(--app-bg);
    color: var(--app-white);
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* App feel */
    font-family: 'Outfit', sans-serif;
}

/* --- Dashboard Container --- */
.dashboard-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Full Screen Feed --- */
.feed-screen {
    flex: 1;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    position: relative;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    /* Mandatory Snap */
    scrollbar-width: none;
}

.feed-screen::-webkit-scrollbar {
    display: none;
}

/* Ensure Feed Screen centers content */
.feed-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--app-bg);
}

.reels-page-view {
    width: 100%;
    max-width: 480px;
    /* Restored Mobile Constraint */
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background-color: #000;
    /* Distinct form app bg if needed */
    overflow: hidden;
    margin: 0 auto;
    /* Center it */
    flex-shrink: 0;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
}

/* Video Player */
.video-player {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    /* Fill screen like app */
}

/* --- Top Bar (Overlay) --- */
/* Matches HomeScreen.dart Triangle/Dropdown design */
.top-bar-overlay {
    position: absolute;
    top: 40px;
    /* Safe Area */
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through */
}

.dropdown-container {
    position: relative;
    pointer-events: auto;
    /* Enable clicks */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-dropdown-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 10px;
}

.category-dropdown-btn img.arrow-icon {
    width: 12px;
    height: 12px;
    margin-left: 8px;
    filter: invert(1);
}

.dropdown-menu-custom {
    display: none;
    position: absolute;
    top: 100%;
    background: white;
    border-radius: 8px;
    padding: 10px 0;
    width: 160px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    align-items: center;
    /* Triangle pointer would go here if strict app match */
}

.dropdown-menu-custom.show {
    display: flex;
}

.dropdown-item-custom {
    padding: 10px 0;
    width: 100%;
    text-align: center;
    font-family: 'Unbounded', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    text-transform: uppercase;
}

.dropdown-item-custom:hover,
.dropdown-item-custom.active {
    color: #000;
}

.dropdown-item-custom.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simulate checkmark for active item */
.dropdown-item-custom.active::after {
    content: '✓';
    margin-top: 5px;
    font-size: 11px;
    color: #ffd700;
}

/* --- Comment Sheet --- */
.comment-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.comment-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.comment-sheet {
    position: absolute;
    bottom: -100%;
    /* Hidden initially */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 70vh;
    background: #1e1e1e;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 1060;
    transition: bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.comment-sheet.show {
    bottom: 0;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.sheet-title {
    color: white;
    font-weight: bold;
}

.close-sheet-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    color: white;
}

.comment-item {
    display: flex;
    margin-bottom: 15px;
}

.comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    -o-object-fit: cover;
    object-fit: cover;
}

.comment-body {
    flex: 1;
    font-size: 0.9rem;
}

.comment-user {
    font-weight: bold;
    color: #ddd;
    font-size: 0.85rem;
}

.comment-text {
    color: #eee;
    margin-top: 2px;
}

.comment-time {
    color: #777;
    font-size: 0.7rem;
    margin-top: 4px;
}

.comment-input-area {
    padding: 10px 15px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    background: #1e1e1e;
    /* Ensure opacity */
    padding-bottom: 20px;
    /* Safe area */
}

.comment-input-area input {
    background: #333;
    border: none;
    color: white;
    border-radius: 20px;
    padding-left: 15px;
}

.comment-input-area input:focus {
    background: #444;
    color: white;
    box-shadow: none;
}

.comment-input-area .send-btn {
    margin-left: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Right Side Actions --- */
/* Matches ReelsScreen.dart */
.right-sidebar {
    position: absolute;
    right: 15px;
    bottom: 90px;
    /* Above Bottom Nav */
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.action-btn i {
    font-size: 26px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.1s;
}

.action-btn:active i {
    transform: scale(0.9);
}

.action-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.profile-avatar-container {
    position: relative;
    margin-bottom: 10px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    -o-object-fit: cover;
    object-fit: cover;
}

.follow-plus-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0050;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* --- Bottom Info Area --- */
.bottom-info {
    position: absolute;
    left: 15px;
    bottom: 90px;
    /* Align with sidebar bottom */
    width: 75%;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.user-handle {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 8px;
    display: block;
    color: white;
    text-decoration: none;
    pointer-events: auto;
}

.video-desc {
    font-size: 14px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-ticker {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.music-ticker i {
    margin-right: 8px;
}

/* --- Bottom Navigation Bar --- */
/* Matches DashboardScreen.dart */
.app-bottom-nav {
    height: 60px;
    /* Standard App Tab Bar height */
    width: 100%;
    background-color: var(--app-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 200;
}


.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--app-grey);
    text-decoration: none;
    transition: color 0.2s;
    flex: 1;
    /* Allow dynamic width based on count */
}

.nav-item.active {
    color: var(--app-white);
}

.nav-icon-img {
    height: 24px;
    width: 24px;
    -o-object-fit: contain;
    object-fit: contain;
    margin-bottom: 4px;
    /* In a real scenario you'd use SVGs or mask-image to colorize assets */
    filter: grayscale(100%) brightness(2);
}

.nav-item.active .nav-icon-img {
    filter: none;
    /* Show original color or white */
}

.create-btn-container {
    width: 45px;
    height: 30px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.create-btn-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #00f2ea 0%, #ff0050 100%);
    border-radius: 8px;
    opacity: 0.9;
}

.create-btn-inner {
    position: relative;
    width: 90%;
    height: 100%;
    background: white;
    /* Or black if creating 'gap' effect */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 2;
}

/* Actually, the TikTok/Shortzz button is usually [ Cyan | White | Red ] overlapping squares or a gradient box. 
   Simulating Shortzz 'GradientIcon' behavior: */
.create-btn-simple {
    background: var(--app-primary);
    width: 45px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* --- Profile Reel Grid --- */
.results-grid {
    grid-template-columns: repeat(3, 1fr);
    /* Mobile Default */
}

@media (min-width: 992px) {

    /* Desktop/Large Screens */
    .results-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        /* 5 Columns for Desktop to reduce height */
    }
}

/* --- Dedicated Story Viewers Sheet --- */
.story-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.story-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.story-sheet {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 70vh;
    background: #1e1e1e;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 2100;
    transition: bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}


/* --- Upload Sheets (Music, Location, Mention) - Centered Modal --- */
.upload-sheet {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 450px;
    height: 70vh;
    background: #1e1e1e;
    border-radius: 20px;
    z-index: 1060;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.upload-sheet.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.story-sheet.show {
    bottom: 0;
}
