/* ═══════════════════════════════════════════════════════
   TverStroyka — Account App Styles
   Custom rules only; Bootstrap 5 handles the rest.
   ═══════════════════════════════════════════════════════ */

/* Roboto Condensed is loaded from Google Fonts in base_common.html */

:root {
  /* Override Bootstrap's global body font stack */
  --bs-body-font-family: 'Roboto Condensed', -apple-system, blinkmacsystemfont, "Segoe UI", roboto, sans-serif;

/* Ensure Bootstrap headings behave correctly */
  h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700 !important; /* Forces headings to use the 700 Bold weight instead of 500 */
  }

  body {
    font-family: "Roboto Condensed", Roboto, sans-serif;
  }

/* ── Header: hide Bootstrap dropdown caret on profile button ─── */
  .ts-profile-btn {
    max-width: 96px;
  }

  .ts-profile-btn::after {
    display: none !important;
  }

  .ts-header-avatar-placeholder {
    font-size: 42px;
    line-height: 1;
  }

/* ── Notification bell badge positioning ─────────────────────── */

  .ts-notif {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .ts-notif .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

/* ── Notifications dropdown ─────────────────────────────────── */

  .ts-notif-menu {
    width: 340px;
    max-width: 95vw;
  }

  .ts-notif-scroll {
    max-height: 200px;
    overflow-y: auto;
  }

  .ts-notif-load-more {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary, #6c757d);
  }

  .ts-notif-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
  }

  .ts-notif-item:hover {
    background-color: var(--bs-light, #f8f9fa);
  }

/* Read items stay visible until next refresh but dimmed for clarity. */
  .ts-notif-item-read {
    opacity: 0.55;
  }

  .ts-notif-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #fd7e14;
    transition: transform 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
  }

  .ts-notif-dot:disabled {
    background-color: #adb5bd;
    cursor: default;
    transform: none;
  }

  .ts-notif-dot:hover:not(:disabled) {
    background-color: #dc3545;
    transform: scale(1.25);
  }

/* ── Anchor target highlight (notification click-throughs) ───── */

/* Push targeted row clear of the sticky header on initial jump. */
  .list-group-item[id^="payment-"],
  .list-group-item[id^="stage-"] {
    scroll-margin-top: 70px;
  }

/* Brief flash to draw the eye to the targeted row. */
  .list-group-item:target {
    animation: ts-target-flash 1.6s ease-out;
  }

  @keyframes ts-target-flash {
    0%   { background-color: #fff3cd; }
    100% { background-color: transparent; }
  }


/* ── Layout: page/content/sidebar dimensions ─────────────────── */

/* Single "useful area" cap for the whole site on wide screens.
   Header, sidebar+content row, and bottom nav all live inside this container. */
  .ts-page {
    max-width: 1000px;
  }

  .ts-content {
    padding-bottom: 90px; /* room for mobile bottom nav */
  }

  .ts-sidebar {
    width: 160px;
    top: 61px;
    max-height: calc(100vh - 61px);
  }

  @media (width >= 768px) {
    .ts-content {
      padding-bottom: 1rem;
    }
  }


/* ── Cards masonry (column-count): stacked on mobile, 2 cols on md+ ── */

  .ts-cards-masonry {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  @media (width >= 768px) {
    .ts-cards-masonry {
      display: block;
      column-count: 2;
      column-gap: 1rem;
    }

    .ts-cards-masonry > .card {
      break-inside: avoid;
      margin-bottom: 1rem;
      width: 100%;
    }
  }


/* ── Fixed bottom nav (mobile only) ──────────────────────────── */

  .ts-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  .ts-nav-item {
    min-width: 62px;
  }


/* ── Active nav state (driven by body[data-page]) ────────────── */

  body[data-page="main"]         [data-nav="main"],
  body[data-page="project"]      [data-nav="project"],
  body[data-page="chat"]         [data-nav="chat"],
  body[data-page="construction"] [data-nav="construction"],
  body[data-page="photos"]       [data-nav="photos"],
  body[data-page="profile"]      [data-nav="profile"] {
    color: var(--bs-primary) !important;
    font-weight: 500;
  }

  body[data-page="main"]    .ts-sidebar [data-nav="main"],
  body[data-page="project"] .ts-sidebar [data-nav="project"] {
    background: rgb(13 110 253 / 8%);
  }


/* ── Widget title: always exactly two lines ──────────────────── */

  .ts-widget-title {
    min-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }


/* ── Image aspect ratios (no Bootstrap utilities for this) ───── */

  .ts-carousel-img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  .ts-hero-img {
    aspect-ratio: 254 / 171;
    object-fit: cover;
    box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
  }

  .ts-photo-grid-img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.2s;
  }

  .ts-photo-grid-img:hover {
    transform: scale(1.03);
  }

/* Clickable images cursor */
  img[data-bs-toggle="modal"] {
    cursor: pointer;
  }


/* ── Carousel controls: visible disc against light card content ── */

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgb(0 0 0 / 5%);
    border-radius: 50%;
    background-size: 50% 50%;
    filter: invert(27%) sepia(100%) saturate(7400%) hue-rotate(355deg) brightness(95%) contrast(110%);
  }

  .carousel-control-prev,
  .carousel-control-next {
    opacity: 0.9;
  }


/* ── Photos page: carousel on mobile, grid on desktop ────────── */

  .ts-photos-grid {
    display: none;
  }

  @media (width >= 768px) {
    .ts-photos-carousel { display: none; }

    .ts-photos-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }
  }

  @media (width >= 1200px) {
    .ts-photos-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }


/* ── Custom slider dots (Bootstrap indicators don't match) ───── */

  .ts-slider-dot {
    width: 32px;
    height: 3px;
    background: #d9d9d9;
  }

  .ts-slider-dot.active {
    background: red;
  }


/* ── Video iframe embed (cropped 16:9 with header hidden) ────── */

  .video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 56.25%;

    --ts-z-video-maximized: 1060;
    --ts-z-video-overlay: 1061;
  }

  .video-iframe {
    position: absolute;
    top: -32px;  /* adjust on changes in provider's feed */
    left: 0;
    width: 100%;
    height: calc(100% + 111px);  /* adjust on changes in provider's feed */
    border: 0;
  }

/* ── Video maximized state ───────────────────────────────────── */

  .video-container.video-maximized {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    z-index: var(--ts-z-video-maximized);
    background: #000;
  }

  .video-container.video-maximized .video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

/* ── Video minimize overlay button ─────────────────────────── */

  .video-minimize-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: var(--ts-z-video-overlay);
    display: none;
    opacity: 0.8;
    transition: opacity 0.2s;
  }

  .video-minimize-overlay:hover {
    opacity: 1;
  }

  .video-container.video-maximized .video-minimize-overlay {
    display: block;
  }


/* ── Profile page large avatar ───────────────────────────────── */

  .ts-avatar-lg,
  .ts-avatar-placeholder {
    width: 220px;
    height: 220px;
    object-fit: cover;
  }
}
