/*/css/reels.css */
:root {
    --primary-color: #3897f0;
    --danger-color: #ff3040;
    --success-color: #4CAF50;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --bg-primary: #000000;
    --bg-secondary: #121212;
    --bg-tertiary: #262626;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

/* Loading States */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.retry-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.retry-button:hover {
    opacity: 0.9;
}

/* Main App Layout */
.reels-app {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
    width: 100%;

  height: 100vh;    /* full viewport height */

  flex-direction: column;
  position: relative;

}

/* Left Sidebar */
.left-sidebar {
    width: 80px;
    background: var(--bg-primary);
    border-right: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.left-sidebar img{
    border-radius: 20px;
}

.sidebar-icons {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.icon-link:hover,
.icon-link.active {
    background: var(--bg-tertiary);
}

.icon-link i {
    font-size: 1.5rem;
}

/* Reel Container */
.reel-container {
    flex: 1;
    margin-left: 80px;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.reel-container::-webkit-scrollbar {
    display: none;
}

/* Reel Item */
.reel-item {
    position: relative;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    
      
  display: grid;
  place-items: center;
  padding-inline: 285px; 
}

/* Video Player */
.player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-secondary);
}

.video-controls {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    opacity: 0;
    transition: var(--transition);
}

.player-wrapper:hover .video-controls {
    opacity: 1;
}

.control-button {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Action Buttons */
.action-buttons {
    position: absolute;
    right: 1rem;
    bottom: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: black;
    
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.action-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.25rem;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.action-icon i {
    font-size: 1.5rem;
}

.action-count {
    font-size: 0.75rem;
    font-weight: 600;
}

/* User Info */
.user-info {
    position: absolute;
    left: 1rem;
    bottom: 6rem;
    max-width: calc(100% - 120px);
    z-index: 10;
}

.user-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 2px solid white;
    object-fit: cover;
}

.username {
    font-weight: 600;
    margin-right: 0.75rem;
}

.follow-button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.follow-button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.reel-caption {
    font-size: 0.875rem;
    line-height: 1.4;
    max-height: calc(1.4em * 3.2);   /* roughly 2 lines when collapsed */
    overflow: hidden;
    
    white-space: normal !important;   /* allow wrapping */
    word-wrap: break-word !important; /* break long hashtags */
    word-break: break-word !important;
    max-width: 30%;                   /* keeps it inside video area */
}

/* when expanded: let it grow as needed */
.reel-caption.expanded {
    max-height: none;
}

/* button styling */
.caption-more-toggle {
    border: none;
    background: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 4px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

@media (prefers-color-scheme: light) {
    .caption-more-toggle {
        color: #000;
    }
}






/* Comment Panel
.comment-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.comment-panel.active {
    transform: translateX(0);
}*/

/* Backdrop */
.panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1100;
  opacity: 0; transition: opacity .2s ease;
}
.panel-backdrop[hidden] { display: none; }

/* Drawer panel */
.comment-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(420px, 92vw);
  background: #fff;
  box-shadow: -10px 0 30px rgba(0,0,0,.25);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 1110; /* above backdrop */
  display: flex; flex-direction: column;
  border-left: 1px solid #eaeaea;
}

/* Open state (desktop) */
.comment-panel.is-open { transform: translateX(0); }

/* Mobile: bottom sheet style */
@media (max-width: 576px) {
  .comment-panel {
    left: 0; right: 0;
    width: 100%;
    height: 80vh;
    margin: 0 auto;
    bottom: -2px;
    transform: translateY(100%);
    border-left: 0; border-top: 8px solid #eee;
    border-radius: 12px 12px 0 0;
  }
  .comment-panel.is-open { transform: translateY(0); }
}

/* Header */
.comment-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}
.comment-panel__title { font-weight: 600; color: #222; }
.comment-panel__close {
  border: 0; background: transparent; font-size: 28px; line-height: 1;
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
}
.comment-panel__close:hover { background: #f2f2f2; }

/* Iframe fills the rest */
.comment-panel__frame {
  flex: 1 1 auto;
  width: 100%; height: 100%;
  border: 0;
  /* Prevent layout jumps on iOS */
  display: block;
}

/* Backdrop visible state (toggle with the panel) */
.comment-panel.is-open + .panel-backdrop { opacity: 1; }


.comment-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.close-comments {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-text {
    font-size: 0.875rem;
}

.comment-input-container {
    padding: 1rem;
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.comment-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bg-tertiary);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.post-comment {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.post-comment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}



@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.share-content {
    padding: 1rem;
}



/* Guest prompt on reels */
.reels-login-prompt{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 420px;
  width: calc(100% - 32px);
  pointer-events: none;          /* so video still scrolls/swipes */
}

.reels-prompt-inner{
  pointer-events: auto;          /* re-enable on the card itself */
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  padding: 14px 16px 12px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
}

.reels-prompt-title{
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
}

.reels-prompt-text{
  margin: 0 0 10px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.reels-prompt-actions{
  display: flex;
  gap: 8px;
}

.reels-btn{
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.reels-btn-primary{
  background: #00B8FF;
  color: #fff;
}

.reels-btn-ghost{
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.55);
}
/*******************************************************************************
*
*
********************************************************************************/

/* Responsive Design */
@media (max-width: 768px) {
    .left-sidebar {
        display: none;
    }
    
    .reel-container {
        margin-left: 0;
    }
    
    .action-buttons {
        right: 0.5rem;
        bottom: 5rem;
        gap: 1rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
    }
    
    .user-info {
        left: 0.5rem;
        bottom: 5rem;
        max-width: calc(100% - 100px);
    }
    
    .comment-panel {
        top: auto;
        height: 70%;
        border-radius: 1rem 1rem 0 0;
    }
    
    .share-modal-content {
        margin: 1rem;
    }
    .action-count{
    color:white;
}
}

@media (max-width: 480px) {
    .action-buttons {
        bottom: 4rem;
    }
    
    .action-count{
    color:white;
}
    
    .user-info {
        bottom: 4rem;
    }
    
    .user-header {
        flex-wrap: wrap;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --bg-tertiary: #000000;
        --border: 2px solid;
    }
}

/* Dark mode is default, but light mode support */
@media (prefers-color-scheme: light) {
    :root {
        --text-primary: #000000;
        --text-secondary: #666666;
        --bg-primary: #ffffff;
        --bg-secondary: #f5f5f5;
        --bg-tertiary: #e0e0e0;
    }
}

/* === YouTube Shorts-like layout additions === */



.player-wrapper {
  position: relative;
  width: min(620px, 100vw);        /* phone-like width on desktop */
  height: calc(min(520px, 100vw) * 16 / 9); /* 9:16 aspect (tall video inside container) */
  max-height: calc(100vh - 142px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Video fills the wrapper like Shorts */
.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Right action rail */
.action-buttons {
  position: absolute;
  right: 12px;
  bottom: 96px;                     /* keep clear of caption area */
  gap: 18px;
}

.action-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.9);
}

/* Bottom-left caption/user area */
.user-info {
  position: absolute;
  left: 12px;
  bottom: 256px;                      /* creates that Shorts-like caption zone */
  right: 84px;                       /* room for the action rail */
  z-index: 10;
  max-width: 75%;
  color: black;
}

.reel-caption {
  text-shadow: 0 1px 8px rgba(0,0,0,0.75);
}

/* Subtle bottom gradient so text is readable on bright frames */
.player-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 40%);
  pointer-events: none;
}

/* Hover controls fade-in (desktop) */
.player-wrapper:hover .video-controls { opacity: 1; }

/* Mobile tweaks */
@media (max-width: 768px) {
  .player-wrapper {
    width: 100vw;
    height: 100vh;
    border-radius: 0;               /* true fullscreen on phones */
    max-height: 100vh;
  }
  .action-buttons { right: 10px; bottom: 200px; color:white; }
  .user-info     { left: 10px; bottom: 190px; right: 74px; max-width: 70%; color: white; }
}


/* Force all reels text to follow theme colors */
.reel-item,
.reel-caption,
.username,

.action-count,
.user-info,
.comment-title,
.comment-text,
.comment-author,
.close-comments,
.share-modal-content,
.share-content {
    color: var(--text-primary) !important;
}

.action-button .action-count {
    color: var(--text-primary) !important;
}


