/* ==========================================================================
   MODAL SYSTEM
   Yêu cầu: main.css load trước — cung cấp tất cả --z-* và color tokens.
   File này KHÔNG khai báo :root.
   ========================================================================== */


/* ==========================================================================
   1. MODAL OVERLAY
   ========================================================================== */
.custom-static-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  /* z-index được đặt tập trung trong main.css section 1 */
}
.custom-static-modal.is-active { display: flex !important; }


/* ==========================================================================
   2. MODAL CONTAINER
   ========================================================================== */
.modal-content-wrapper {
  background: var(--bg-card);
  width: 95%;
  max-width: 750px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255,255,255,.1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) transparent;
  animation: modalFadeIn .3s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-content-wrapper::-webkit-scrollbar        { width: 5px; }
.modal-content-wrapper::-webkit-scrollbar-button { display: none; }
.modal-content-wrapper::-webkit-scrollbar-track  { background: transparent; }
.modal-content-wrapper::-webkit-scrollbar-thumb  { background: var(--color-scrollbar); border-radius: 20px; }


/* ==========================================================================
   3. HEADER IMAGE
   ========================================================================== */
.modal-header-img {
  height: 300px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-status-tag {
  position: absolute;
  bottom: 20px; left: 20px;
  padding: 5px 15px;
  border-radius: 20px;
  color: var(--text);
  font-size: 13px; font-weight: 700;
}

/* ==========================================================================
   3.1 VIEW GALLERY BUTTON
   ========================================================================== */
.btn-view-gallery {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    opacity: 0;
    transition: opacity .2s, transform .2s;  
    font-size: 14px;  
    font-weight: 400;
}
.modal-header-img {
    cursor: zoom-in; /* báo hiệu có thể click */
}
.modal-header-img:hover .btn-view-gallery {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
}

/* ==========================================================================
   4. CLOSE BUTTON
   ========================================================================== */
.modal-close-overlay {
  /* đặt tập trung trong main.css (.close-btn rule) */
}
.modal-close-overlay svg{
  /* đặt tập trung trong main.css  */
}
.modal-close-overlay:hover {  /* đặt tập trung trong main.css  */  }
.modal-close-overlay:hover svg{  /* đặt tập trung trong main.css  */}

/* Legacy close button */
/*.close-btn {
  position: absolute;
  top: 20px; right: 25px;
  font-size: 35px; line-height: 1;
  color: var(--text); cursor: pointer;
}*/

/* ==========================================================================
   4.1 SHARE BUTTON
   ========================================================================== */
.btn-share {
    background-color: #2E3246;
    color: #ffffff;
    border: 1px solid #3F445E;
    padding: 0.75rem;
    border-radius: 1rem;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s;
}
.btn-share:hover {
    color: rgb(244 114 182);
}

/* ==========================================================================
   5. MAIN CONTENT AREA
   ========================================================================== */
.modal-main-content { padding: 20px; }


/* ==========================================================================
   6. TITLE ROW
   ========================================================================== */
.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-title-text { font-weight: 600; color: var(--text); margin: 0; }

.btn-share-circle {
  background: rgba(255,255,255,.1);
  border: none;
  width: 35px; height: 35px;
  border-radius: 50%;
  color: var(--text); cursor: pointer; font-size: 14px;
}


/* ==========================================================================
   7. TAGS ROW
   ========================================================================== */
.modal-tags-row {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 12px;
  color: var(--text-muted);
}
.tag-yellow  { color: var(--color-star); font-weight: bold; }
.modal-meta-info { color: var(--text-dim); margin-bottom: 25px; }


/* ==========================================================================
   8. STATS BAR
   ========================================================================== */
.modal-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-item {
  background: rgba(255,255,255,.05);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  font-size: 13px;
  display: flex;     
  align-items: center;  
  gap: 6px;   
}
.stat-item svg{
  color: var( --color-open);
}
.stat-item svg span:first-child {
    color: var(--text-muted);
}
/* ==========================================================================
   9. PRIMARY BUTTON — Chỉ đường
   ========================================================================== */
.btn-primary-gradient {
  display: flex;
  width: 100%;
  background: var(--gradient-pink);
  color: var(--text);
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 700; font-size: 14px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(214,51,132,.2);
  transition: opacity .3s, transform .3s;
  align-items: center; 
  justify-content: center;
  gap: 5px; 
}
.btn-primary-gradient:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary-gradient > span { font-weight: 400; }


/* Legacy modal map button */
.modal-btn-map {
  display: block;
  margin-top: 15px;
  background: var(--primary-blue);
  color: var(--text);
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none; font-weight: 700;
}


/* ==========================================================================
   10. GRID LAYOUT
   ========================================================================== */
.modal-grid {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  margin-top: 10px;
}
.modal-left-col  { width: 100%; }
.modal-right-col { width: 100%; display: grid; grid-template-columns: 1fr; gap: 15px; }
.modal-inner     { width: 100%; }


/* ==========================================================================
   11. CONTENT CARD
   ========================================================================== */
.content-card {
  background: var(--bg-card-2);
  padding: 15px;
  border-radius: var(--radius-lg);
  margin-bottom: 15px;
}

/* Legacy */
.modal-info-box {
  background: var(--bg-card-2);
  padding: 20px;
  border-radius: var(--radius-lg);
}
.modal-info-box p      { margin: 0 0 12px; color: var(--text); }
.modal-info-box strong { color: var(--text); }

.modal-sub-title {
  margin: 0 0 10px;
  color: var(--primary-blue);
  display: flex;     
  align-items: center;  
  gap: 2px;
}

.modal-sub-title span{
  font-size: 16px; font-weight: 400;
/*  color: var(--text);*/
}
.modal-text-entry,
.quote-box,
.review-text { font-size: 13px; line-height: 1.5; color: var(--text-muted); }

.modal-text-entry { color: var(--text); line-height: 1.7; }
.modal-text-entry img    { max-width: 100%; height: auto; border-radius: 12px; }
.modal-text-entry iframe,
.modal-text-entry video  { max-width: 100%; }

.quote-box {
  background: rgba(0,0,0,.2);
  padding: 12px; border-radius: 10px; font-style: italic;
}

.btn-read-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #4ade80;
  text-decoration: none;
  transition: opacity .2s;
}
.btn-read-more:hover { opacity: .75; }

/* ==========================================================================
   12. COMMENT LIST AREA
   ========================================================================== */
#comment-list-area {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 300px;
  overflow-y: auto; overflow-x: hidden;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) rgba(255,255,255,.05);
}
#comment-list-area > div        { width: 100% !important; display: block; }
#comment-list-area > .no-review { font-size: 14px; font-weight: 400; }

#comment-list-area::-webkit-scrollbar             { width: 6px; }
#comment-list-area::-webkit-scrollbar-track       { background: rgba(255,255,255,.05); border-radius: 10px; }
#comment-list-area::-webkit-scrollbar-thumb       { background: var(--color-scrollbar); border-radius: 10px; }
#comment-list-area::-webkit-scrollbar-thumb:hover { background: var(--color-scrollbar-hover); }


/* ==========================================================================
   13. REVIEW CARD
   ========================================================================== */
.review-card {
  background: rgba(255,255,255,.04);
  border-radius: 5px; padding: 5px; margin-bottom: 5px;
  border: 1px solid rgba(255,255,255,.05);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.review-user-info { display: flex; align-items: center; gap: 12px; }

.review-avatar img {
  width: 42px; height: 42px;
  border-radius: 50% !important;
  object-fit: cover;
}

.review-avatar-char {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-weight: 500; font-size: 14px;
  text-transform: uppercase; flex-shrink: 0;
  background: var(--gradient-pink);
  box-shadow: 0 2px 8px rgba(214,51,132,.3);
  border-radius: 50%;
}

.review-meta   { display: flex; flex-direction: column; }
.review-author { font-size: 14px; color: var(--text); font-weight: 400; line-height: 1.2; }
.review-time   { font-size: 12px !important; color: var(--text-muted) !important; margin-top: 2px; }
.review-content { font-size: 14px !important; line-height: 1.6 !important; color: var(--text-body) !important; }


/* ==========================================================================
   14. REVIEW STARS
   ========================================================================== */
.star-icon    { width: 12px; height: 12px; margin-right: 2px; vertical-align: middle; }
.star-filled  { fill: var(--color-star); stroke: var(--color-star); stroke-width: 2px; }
.star-empty   { fill: none; stroke: rgba(241,196,15,.8); stroke-width: 2px; }
.stars-yellow { font-size: 11px; color: var(--color-star); }


/* ==========================================================================
   15. COMMENT SECTION
   ========================================================================== */
.modal-comment-section {
  background: rgba(255,255,255,.03);
  padding: 20px; border-radius: 15px;
  margin-top: 10px;
  border: 1px dashed rgba(255,255,255,.1);
  width: 100%; box-sizing: border-box; clear: both;
}
.modal-comment-section .modal-sub-title {
  font-size: 14px !important;
  margin-bottom: 10px !important;
  display: flex; align-items: center; gap: 5px;
}

.rating-selection {
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 15px;
}
.rating-selection span        { font-size: 13px; color: var(--text-muted); }
.star-rating-input label      { font-size: 20px; }

.modal-comment-section textarea {
  background: rgba(0,0,0,.2) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  padding: 10px 15px !important;
  height: 45px; min-height: 45px;
  border-radius: 10px !important;
  transition: all .3s ease;
  resize: none;
}
.modal-comment-section textarea:focus {
  height: 80px;
  border-color: var(--accent-pink) !important;
  outline: none;
}
.modal-comment-section .btn-primary-gradient {
  width: auto !important;
  padding: 8px 25px !important;
  font-size: 13px !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  float: right;
}
.modal-comment-section form::after { content: ''; display: table; clear: both; }


/* ==========================================================================
   16. LEGACY — Custom Scroll Area / Review User
   ========================================================================== */
.custom-scroll-area {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 12px; margin-right: -5px;
}
.custom-scroll-area::-webkit-scrollbar             { width: 6px; }
.custom-scroll-area::-webkit-scrollbar-track       { background: rgba(255,255,255,.05); border-radius: 10px; }
.custom-scroll-area::-webkit-scrollbar-thumb       { background: var(--color-scrollbar); border-radius: 10px; }
.custom-scroll-area::-webkit-scrollbar-thumb:hover { background: var(--color-scrollbar-hover); }

.review-user   { display: flex; gap: 10px; margin-bottom: 8px; }
.avatar-circle {
  width: 32px; height: 32px;
  background: var(--accent-pink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 12px;
}


/* ==========================================================================
   17. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .custom-static-modal { padding: 8px; }
  .modal-content-wrapper { width: 100%; max-height: 92vh; border-radius: 12px; }
  .modal-header-img      { height: 220px; }
  .modal-main-content    { padding: 15px 12px; }
  .modal-title-text      { font-size: 18px; line-height: 1.3; }
  .btn-share-circle      { width: 30px; height: 30px; font-size: 12px; }
  .modal-tags-row        { margin-bottom: 10px; font-size: 11px; }
  .modal-stats-bar       { gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
  .stat-item             { padding: 4px 10px; font-size: 12px; }
  .modal-grid            { grid-template-columns: 1fr; gap: 12px; }
  .content-card          { padding: 12px; margin-bottom: 12px; }
  .modal-comment-section { padding: 15px 12px; }
  #comment-list-area     { max-height: 350px; gap: 10px; }
  .review-header         { margin-bottom: 8px; }
  .review-avatar-char    { width: 32px; height: 32px; font-size: 12px; }
  .btn-primary-gradient  { padding: 12px; margin-bottom: 15px; }
}

@media (max-width: 380px) {
  .modal-header-img { height: 160px; }
  .modal-title-text { font-size: 16px; }
  .stat-item        { width: 100%; text-align: center; }
}


