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

@media (max-width: 575.98px) {
    .devotion-wrapper {
        width: 100%;
        margin-inline: auto;
        padding: 0 !important;
    }
    
    .devotion-card {
        min-width: 100vw;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }
    
    body {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (min-width: 768px) {
    .devotion-wrapper {
        width: 80vw;
        margin-inline: auto;
    }
    
    .devotion-card {
        max-width: 75vw;
    }
}

/* ========================================
   CARD STYLING
   ======================================== */

.devotion-card {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.devotion-separator {
    margin: 0;
    border: 0;
    border-top: 1px solid #ccc;
}

/* ========================================
   POST IMAGE RESPONSIVE
   ======================================== */

.devotion-post-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@media (min-width: 768px) {
    .devotion-post-img {
        width: 45vw;
        height: auto;
    }
}

/* ========================================
   STATS ROW - LEFT ALIGNED
   ======================================== */

.stats-row {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    align-items: center;
    gap: 0.75rem !important;
    color: #555 !important;
    font-weight: 500;
    margin-bottom: 4px !important;
    padding-left: 0 !important;
}

.stats-row > * {
    flex: 0 0 auto !important;
    white-space: nowrap;
}

.stats-row .bi {
    color: #666 !important;
    vertical-align: middle;
    margin-right: 2px;
}

.stats-row span,
.stats-row a {
    color: inherit !important;
}

.stats-row a.stat-comment {
    text-decoration: none;
    transition: color 0.2s ease;
}

.stats-row a.stat-comment:hover {
    color: #333 !important;
}
/* 
Play Button
*/
.play-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #000;
    cursor: pointer;
}

.play-btn {
    position: absolute;
    z-index: 2;
}
#commentsModal .video-player {
    outline: 3px solid red;
}

/*
.video-inner {
    position: relative;
}*/

/*
Video 


.video-inner {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio 
}
*/
/*.video-inner  {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}*/
.video-inner {
    position: absolute;
    inset: 0;
}
#commentsModal .video-player {
    /*position: absolute !important; */
    inset: 0;
    width: 100%;
    height: 100%;
    display: block !important;
    visibility: visible !important;
}


.play-overlay {
    z-index: 2;
}
/*.video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 5; /* MUST be higher than overlays 
} */
.video-player {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:contain;
    background:#000;
    z-index:5;
}


/* ========================================
   ACTION BUTTONS
   ======================================== */

.devotion-action-btn {
    width: auto !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-inline: 0.65rem;
    white-space: nowrap;
}

#devotionals .actions-row .btn,
#commentsModal .btn {
    font-size: 0.70rem !important;
    padding: 2px 6px !important;
    line-height: 1.1 !important;
    border-radius: 4px !important;
}

#devotionals .actions-row .btn i,
#commentsModal .btn i {
    font-size: 0.80rem !important;
}

/* ========================================
   MODAL STYLING
   ======================================== */

#commentsModal .modal-dialog {
    max-width: 95vw;
    margin: 0 auto;
}

@media (min-width: 768px) {
    #commentsModal .modal-dialog {
        max-width: 70vw;
    }
}

#commentsModal .modal-body {
    padding: 8px 12px !important;
}

#commentsModal .modal-post-img {
    width: 90% !important;
    max-width: 90% !important;
    height: auto !important;
    margin: 0 auto;
    display: block;
}

@media (min-width: 768px) {
    #commentsModal .modal-post-img {
        width: 50% !important;
        max-width: 50% !important;
    }
}

/* ========================================
   MODAL AUTHOR HEADER - FIX #2
   Image aligned to top, name and date SIDE BY SIDE
   ======================================== */

.modal-devotion-author {
    display: flex;
    align-items: flex-start !important;
    gap: 8px;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
}

.modal-author-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Name and date side by side */
.modal-author-info {
    display: flex;
    flex-direction: row !important;          /* SIDE BY SIDE */
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
}

.modal-author-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 !important;
    white-space: nowrap;
}

.modal-author-date {
    font-size: 0.75rem;
    color: #777;
    margin: 0 !important;
    white-space: nowrap;
}

/* Poster row in modal header - name and date side by side */
#commentsModal #devotionHeader .poster-row {
    display: flex;
    align-items: flex-start !important;
    gap: 8px;
    margin-bottom: 6px !important;
    padding: 0 !important;
}

#commentsModal #devotionHeader .poster-row img {
    width: 40px !important;
    height: 40px !important;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 50%;
}

#commentsModal #devotionHeader .poster-row .modal-author-info {
    display: flex;
    flex-direction: row !important;          /* SIDE BY SIDE */
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
}

/* Modal meta - stats + buttons left aligned */
#commentsModal .modal-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start !important;
}

#commentsModal .modal-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    align-items: center;
    gap: 0.75rem !important;
    line-height: 1.2;
    color: #6c757d !important;
}

#commentsModal .modal-stats * {
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#commentsModal .modal-buttons {
    justify-content: flex-start !important;
}

#commentsModal .modal-buttons .btn {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    line-height: 1.1 !important;
    border-radius: 4px !important;
}

/* ========================================
   COMMENTS SECTION - MINIMAL PADDING - FIX #1
   ======================================== */

#commentsList {
    gap: 2px !important;
}

#commentsList.vstack {
    gap: 2px !important;
}

#commentsModal .comment-row,
#commentsList .comment-row,
#commentsList > div {
    padding: 4px 6px !important;
    margin: 0 0 2px 0 !important;
    border-radius: 4px !important;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef !important;
}

#commentsList .p-0,
#commentsList .p-1,
#commentsList .p-2 {
    padding: 4px 6px !important;
}

#commentsList .d-flex,
.comment-row .d-flex {
    gap: 6px !important;
}

#commentsList img,
.comment-row img {
    width: 28px !important;
    height: 28px !important;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 50% !important;
}

#commentsList .flex-grow-1,
.comment-row .flex-grow-1 {
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
}

#commentsList .d-flex.justify-content-between,
.comment-row .d-flex.justify-content-between {
    margin-bottom: 1px !important;
    gap: 8px !important;
}

#commentsList .fw-semibold,
.comment-row .fw-semibold {
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
}

#commentsList .text-muted small,
.comment-row .text-muted small,
#commentsList .time-ago,
.comment-row .time-ago {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
}

#commentsList .flex-grow-1 > div:last-child,
.comment-row .flex-grow-1 > div:last-child {
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#commentForm {
    gap: 6px !important;
    margin-bottom: 10px !important;
}

#commentForm .d-flex {
    gap: 6px !important;
}

#commentForm textarea {
    min-height: 40px;
    font-size: 0.85rem;
    padding: 6px 8px !important;
}

#commentForm #currentUserAvatar {
    width: 32px !important;
    height: 32px !important;
}

/* ========================================
   READ MORE TOGGLE
   ======================================== */
#feed .detail-preview,
#feed .detail-ellipsis {
    display: inline;
}
#feed .detail-rest {
    display: none;
}
#feed .detail-rest:not([hidden]) {
    display: inline;
}
#feed .devot-text,
#feed .devot-text * {
    color: #111;
    opacity: 1;
    visibility: visible;
}
#feed .read-toggle {
    cursor: pointer;
    white-space: nowrap;
}
[hidden] {
    display: none !important;
}
/* ========================================
   SHARE MODAL STYLING
   ======================================== */

.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.share-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.share-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 350px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.share-modal-overlay.show .share-modal-content {
    transform: translateY(0);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.share-modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.share-modal-close:hover {
    color: #333;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.share-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.share-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.share-option-label {
    font-size: 0.7rem;
    color: #333;
    text-align: center;
}

.share-option-icon.twitter { background: #000000; }
.share-option-icon.facebook { background: #1877f2; }
.share-option-icon.whatsapp { background: #25d366; }
.share-option-icon.linkedin { background: #0a66c2; }
.share-option-icon.tiktok { background: #000000; }
.share-option-icon.email { background: #ea4335; }
.share-option-icon.copy { background: #6c757d; }

/* Time ago styling */
.time-ago {
    font-size: inherit;
    color: inherit;
}

/*

VIDEO CSS
*/
    :root {
      --header-h: 70px;
      --footer-h: 70px;
    }
    
    /* Video card styling */
    .video-card .card-body { 
      padding: .75rem; 
    }
    .video-card .card-title { 
      margin-bottom: .25rem; 
      font-size: 1rem; 
    }
    
    /* Avatar styling */
    .u-avatar {
      width: 36px; 
      height: 36px; 
      object-fit: cover;
    }
    
    /* Meta info styling */
    .u-meta {
      line-height: 1;
    }
    .u-meta span,
    .u-meta small {
      white-space: nowrap;
    }
    .u-meta span.fw-semibold {
      color: #000 !important;
    }
    .u-meta small {
      color: #6c757d !important;
    }
    
    /* Video container - FIXED */
    .video-container {
      position: relative;
      width: 100%;
      padding-top: 56.25%; /* 16:9 aspect ratio */
      background: #000;
      border-radius: 8px;
      overflow: hidden;
    }
    .video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
   
    
    /* Play overlay */
    .play-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
      cursor: pointer;
      z-index: 2;
      transition: background 0.2s;
    }
    
    .play-overlay:hover {
      background: linear-gradient(135deg, #252545 0%, #1e2a4a 100%);
    }
    
    .play-overlay.hidden {
      display: none;
    }
    
    .play-btn {
      width: 70px;
      height: 70px;
      background: rgba(255,255,255,0.95);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 15px rgba(0,0,0,0.3);
      transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .play-overlay:hover .play-btn {
      transform: scale(1.1);
      box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    }
    
    .play-btn::after {
      content: '';
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 15px 0 15px 25px;
      border-color: transparent transparent transparent #333;
      margin-left: 5px;
    }
    
    /* Loading state */
    .loading-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: none;
      align-items: center;
      justify-content: center;
      background: #000;
      z-index: 3;
    }
    
    .loading-overlay.show {
      display: flex;
    }
    
    .spinner {
      width: 50px;
      height: 50px;
      border: 4px solid rgba(255,255,255,0.2);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    
    /* Error state */
    .error-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: #1a1a2e;
      color: #fff;
      z-index: 4;
      text-align: center;
      padding: 20px;
    }
    
    .error-overlay.show {
      display: flex;
    }
    
    .error-icon {
      font-size: 3rem;
      margin-bottom: 10px;
    }
    
    .error-text {
      margin-bottom: 15px;
      font-size: 0.9rem;
      opacity: 0.9;
    }
    
    .retry-btn {
      padding: 8px 20px;
      background: #fff;
      color: #333;
      border: none;
      border-radius: 20px;
      cursor: pointer;
      font-size: 0.9rem;
      transition: transform 0.2s;
    }
    
    .retry-btn:hover {
      transform: scale(1.05);
    }
    
 
    
    .video-player.show {
      display: block;
    }
    /* Single centered card, 60% max width */
/* Remove the separate video-card max-width — let it match devotion-card */
.video-card {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    /* No max-width here — inherits from devotion-wrapper */
}

/* Mobile: handled by devotion-card rules already */
@media (max-width: 767px) {
    .video-card {
        max-width: 100%;
    }
}

@media (min-width: 768px) {
    .video-card {
        max-width: 75vw; /* Same as devotion-card */
    }
}
/* Fit video in viewport height */
.video-wrapper {
  max-height: 70vh;
}

.video-aspect {
  padding-bottom: 56.25%; /* 16:9 */
  max-height: 70vh;
}

.video-aspect video {
  object-fit: contain;
}

/* Mobile: full width */

