/* ============================================================
   enhancements.css — Git Cards v3.2
   Responsive layout system + micro-interactions on top of Tailwind
   ============================================================ */

/* ── 1. APP SHELL — Responsive Layout ─────────────────────── */

/* Body wrapper: always column (top-bar stacked above view-root) */
#app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
  min-width: 0;
}

/* ── 2. SIDEBAR — Desktop navigation (≥1024px) ─────────────── */

#sidebar-nav {
  display: none; /* hidden by default (mobile/tablet) */
}

@media (min-width: 1024px) {
  /* Make body the flex-row container for sidebar + content column */
  body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding-bottom: 0 !important;
  }

  /* Sidebar */
  #sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-width: 220px;
    height: 100dvh;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 40;
    border-right: 1px solid rgba(0,0,0,0.08);
    background: var(--sidebar-bg, #ffffff);
    padding: 20px 12px;
    gap: 4px;
    overflow-y: auto;
    transition: background 0.3s ease;
    animation: sidebarEnter 0.3s cubic-bezier(0.16,1,0.3,1) both;
  }
  .dark #sidebar-nav {
    background: #1D251E;
    border-right-color: rgba(255,255,255,0.08);
  }

  /* Sidebar logo section */
  .sidebar-logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    margin-bottom: 8px;
  }
  .dark .sidebar-logo-section { border-bottom-color: rgba(255,255,255,0.08) }

  /* Sidebar nav items */
  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #3e4942;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
  }
  .dark .sidebar-nav-item { color: rgba(234,242,237,.75) }
  .sidebar-nav-item:hover {
    background: rgba(0,106,69,0.08);
    color: #006a45;
    transform: translateX(2px);
  }
  .dark .sidebar-nav-item:hover {
    background: rgba(142,247,192,0.1);
    color: #8ef7c0;
  }
  .sidebar-nav-item.active {
    background: linear-gradient(135deg, #006a45, #5b6300);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,106,69,0.25);
  }
  .sidebar-nav-item .material-symbols-outlined {
    font-size: 20px;
  }

  /* Sidebar bottom: logout */
  .sidebar-logout {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.07);
  }
  .dark .sidebar-logout { border-top-color: rgba(255,255,255,0.08) }

  /* app-body fills remaining width, stacks top-bar above view-root */
  #app-body {
    flex: 1;
    min-width: 0;
    min-height: 100dvh;
  }

  /* Main content area scrolls independently */
  #view-root {
    flex: 1;
    overflow-y: auto;
  }

  /* Hide bottom nav on desktop */
  #bottom-nav {
    display: none !important;
  }
}

/* ── 3. TABLET — Wider content, 2-col grids (768–1023px) ───── */

@media (min-width: 768px) and (max-width: 1023px) {
  .responsive-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .responsive-3col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  /* Wider max-width for content */
  .login-page  { max-width: 580px !important; }
  .page-content { max-width: 960px !important; margin-inline: auto; }
}

/* ── 4. DESKTOP — Full layout (≥1024px) ────────────────────── */

@media (min-width: 1024px) {
  .responsive-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .responsive-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .responsive-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  /* Dashboard: 2-col layout */
  .dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
  }
  /* Settings: 2-col (form + preview) */
  .settings-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
  }
  /* Cards: 2 per row */
  .card-deck-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 960px !important;
  }
  /* Login page: centered card, wider */
  .login-page {
    max-width: 520px !important;
  }
  /* Full-width content area */
  .page-content {
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 32px;
  }
}

/* ── 5. MICRO-INTERACTIONS ─────────────────────────────────── */

/* 3D card perspective hover */
.card-3d {
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.card-3d:hover {
  transform: perspective(900px) rotateX(3deg) rotateY(-3deg) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.12);
}
.dark .card-3d:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.3);
}

/* Input focus glow */
.input-glow:focus-within {
  box-shadow: 0 0 0 3px rgba(0,106,69,0.18);
  border-color: #006a45 !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.dark .input-glow:focus-within {
  box-shadow: 0 0 0 3px rgba(142,247,192,0.15);
  border-color: #8ef7c0 !important;
}

/* Smooth hover lift for cards/sections */
.hover-lift {
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.dark .hover-lift:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* Interactive row highlight */
.row-interactive {
  transition: background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.row-interactive:hover {
  background: rgba(0,106,69,0.05) !important;
  transform: translateX(2px);
}
.dark .row-interactive:hover {
  background: rgba(142,247,192,0.05) !important;
}

/* Smooth scroll for all scrollable areas */
* { scroll-behavior: smooth; }

/* Logo glow on login */
.login-logo-wrap {
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.login-logo-wrap:hover {
  transform: scale(1.05);
}

/* Nav tab active indicator glow */
.bottom-nav-active-glow {
  box-shadow: 0 0 12px rgba(0,106,69,0.35);
}

/* Announcement card */
.announcement-card {
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
}
.announcement-card:hover {
  transform: translateY(-2px) translateX(2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: rgba(0,106,69,0.3) !important;
}

/* ── 6. SCROLLBAR STYLING ──────────────────────────────────── */

::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(0,0,0,0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── 7. SELECTION COLOR ────────────────────────────────────── */

::selection { background: rgba(0,106,69,0.2); color: inherit; }
.dark ::selection { background: rgba(142,247,192,0.2); }
