@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Outfit:wght@100..900&display=swap');

:root {
  --primary-ytd: #f25d07;
  --primary-gradient: linear-gradient(135deg, #f25d07 0%, #ff7a2d 100%);
  --secondary-ytd: #262423;
  --dark-ytd: #1a1918;
  --sidebar-bg: #262423;
  --accent-ytd: #ff8c42;
  --bg-color: #f4f7fa;
  --text-main: #262423;
  --text-muted: #6b7280;
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.4);
  
  --card-shadow: 0 20px 40px rgba(38, 36, 35, 0.04);
  --card-shadow-hover: 0 30px 60px rgba(38, 36, 35, 0.08);
  
  --border-radius-xl: 20px;
  --border-radius-lg: 14px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
}

body {
  background: var(--bg-color);
  font-family: "Figtree", sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

h1, h2, h3, h4, h5, h6, .outfit {
  font-family: "Outfit", sans-serif;
}

/* Sidebar Styling - Modern Dark Charcoal */
#wrapper {
  display: flex;
  width: 100vw;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Structure */
#sidebar-wrapper {
  height: 100vh;
  position: sticky;
  top: 0;
  width: 280px;
  background: var(--sidebar-bg);
  color: white;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

#sidebar-wrapper .sidebar-heading {
  padding: 2.5rem 1.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: "Outfit", sans-serif;
  color: white;
}

#sidebar-wrapper .list-group-item {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 4px 14px;
  border-radius: var(--border-radius-sm);
  position: relative;
  z-index: 1;
}

#sidebar-wrapper .list-group-item i {
  width: 20px;
  font-size: 1.25rem;
  opacity: 0.8;
  margin-right: 0;
}

#sidebar-wrapper .list-group-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.75rem;
  transform: none;
}

#sidebar-wrapper .list-group-item.active {
  background: var(--primary-gradient) !important;
  color: white !important;
  border-radius: var(--border-radius-sm);
  margin-right: -15px; /* Premium 15px overlap maintained */
  margin-left: 20px;
  padding-left: 1.5rem;
  box-shadow: 10px 10px 25px rgba(242, 93, 7, 0.2);
  z-index: 100 !important;
}

#sidebar-wrapper .list-group-item.active i {
  color: white;
  opacity: 1;
}

/* Dashboard Stat Cards - Keep as simple numbers as requested */
.stat-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Universal Content Grid - Default size for Organizations */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem;
}

/* Compact Content Grid - For Offerings */
.content-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem;
}

.content-card {
  background: white;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.03);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.content-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-ytd); /* Primary color border on hover */
}

.content-card-img {
  position: relative;
  height: 160px; /* Smaller card height */
  overflow: hidden;
  background: #f1f5f9;
}

.content-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.content-card:hover .content-card-img img {
  transform: scale(1.05);
}

.content-badge-group {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
}

.content-badge {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-card-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.content-card-title {
  font-family: 'Outfit';
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-ytd);
}

.content-card-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #fafafa;
  border-top: 1px solid rgba(0,0,0,0.02);
}

.btn-card-action {
  background: white;
  color: var(--secondary-ytd);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.btn-card-action:hover {
  background: var(--secondary-ytd);
  color: white;
  border-color: var(--secondary-ytd);
}

.btn-card-more {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.btn-card-more:hover {
  background: #f1f5f9;
  color: var(--secondary-ytd);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Outfit';
  color: var(--secondary-ytd);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Main Content area */
#page-content-wrapper {
  width: 100%;
  min-width: 0;
  padding: 0; /* Remove default padding to let navbar be flush */
}

.content-container-inner {
    padding: 2rem 2.5rem;
}

/* Modern Header / Navbar - Fixed to top */
.main-navbar {
  background: white;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  border-radius: 0;
  margin-bottom: 0px;
  padding: 0 2.5rem;
  height: 70px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1020;
  width: 100%;
}

.main-navbar .container-fluid {
    height: 100%;
    padding: 0;
}

#nav-search-container {
    background: #f4f7fa;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 350px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

#nav-search-container:focus-within {
    background: white;
    border-color: var(--primary-ytd);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#nav-search-container input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
}

#nav-search-container kbd {
    background: white;
    color: #999;
    border: 1px solid #eee;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Premium Cards */
.card {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--card-shadow);
  border-radius: var(--border-radius-lg);
  background: white;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
  transform: translateY(-5px);
  border: 1px solid var(--primary-ytd) !important;
  box-shadow: 0 15px 35px rgba(242, 93, 7, 0.1) !important;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding: 1.25rem 1.5rem;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Buttons - Ultra Smooth */
.btn {
  border-radius: var(--border-radius-sm);
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-gradient);
  border: none;
  color: white;
  box-shadow: 0 8px 16px rgba(242, 93, 7, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 24px rgba(242, 93, 7, 0.3);
  background: var(--primary-gradient);
}

.btn-white {
  background: white;
  border: 1px solid #e5e7eb;
  color: var(--secondary-ytd);
}

.btn-white:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Fluid Tables */
.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f9fafb;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--text-muted);
  border-top: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding: 1rem 1.5rem;
  font-family: "Outfit", sans-serif;
}

.table tbody td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  font-size: 0.9rem;
}

.table-img {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Form Styling - Figtree */
.form-label {
  font-weight: 700;
  color: var(--secondary-ytd);
  margin-bottom: 0.5rem;
  font-family: "Outfit", sans-serif;
}

.form-control, .form-select {
  padding: 0.8rem 1.2rem;
  border-radius: var(--border-radius-sm);
  border: 2px solid #f3f4f6;
  background-color: #f9fafb;
  font-family: "Figtree", sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
}

.form-control:focus {
  background-color: white;
  border-color: var(--primary-ytd);
  box-shadow: 0 0 0 4px rgba(242, 93, 7, 0.1);
  outline: none;
}

/* Fluid Modals */
.modal-content {
  border: none;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.15);
}

.modal-header {
  padding: 2.5rem 2.5rem 1rem;
}

.modal-body {
  padding: 1rem 2.5rem 2.5rem;
}

/* Status Badges */
.badge {
  padding: 0.6em 1em;
  font-weight: 700;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: "Outfit", sans-serif;
}

/* Statistics Widgets */
.stat-card {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-color);
}

/* Glass Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--border-radius-lg);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-ytd);
}

/* Stack Table for Mobile - Optimized Density & Hero Cards */
@media (max-width: 768px) {
  body {
    background: #f0f2f5 !important; /* Distinct gray background */
  }

  #page-content-wrapper {
    padding: 2.5rem 0.4rem 1rem !important;
  }

  /* Maximize space on mobile */
  .container-fluid {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  /* Only make the table-wrapping cards transparent on mobile */
  .card.p-0.overflow-hidden {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  
  /* Ensure individual cards (like in Temple Content) remain visible */
  #content-grid .card {
    background: white !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
    border: 1px solid rgba(0,0,0,0.02) !important;
    padding: 0 !important;
    margin-bottom: 0;
  }

  /* Minimized Mobile Search Container */
  .card.rounded-pill.mb-5 {
    border-radius: 12px !important;
    padding: 0.5rem !important;
    margin-bottom: 2rem !important;
    background: white !important;
  }
  
  .card.rounded-pill.mb-5 .row.g-2 {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  .card.rounded-pill.mb-5 .col-md-2 {
    width: 100%;
  }

  .card.rounded-pill.mb-5 .btn-primary {
    padding: 0.75rem !important;
    border-radius: 10px !important;
    width: 100%;
  }

  .card.rounded-pill.mb-5 .px-4 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* Table Persistence: Standard Scrollable Table with Sticky Header */
  .table-responsive {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 1rem;
    max-height: 70vh;
  }

  .table {
    display: table !important;
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  .table thead {
    display: table-header-group !important;
  }

  .table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc !important;
    white-space: nowrap;
    padding: 1rem 0.75rem !important;
    border-bottom: 2px solid #edf2f7;
  }

  .table tbody {
    display: table-row-group !important;
  }

  .table tr {
    display: table-row !important;
  }

  .table td {
    display: table-cell !important;
    white-space: nowrap !important;
    padding: 1rem 0.75rem !important;
    vertical-align: middle !important;
    font-size: 0.85rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
  }

  .table td::before {
    display: none !important;
  }

  /* Tab Container Mobile Fix (Horizontal Scroll) */
  .tab-container-glass {
    margin-left: -0.4rem;
    margin-right: -0.4rem;
    width: calc(100% + 0.8rem) !important;
    border-radius: 0 !important;
    padding: 0.5rem !important;
    overflow-x: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    background: white !important;
  }

  .nav-pills {
    flex-wrap: nowrap !important;
    display: flex !important;
  }

  .nav-pills .nav-link {
    white-space: nowrap !important;
    flex-shrink: 0;
  }
}

/* Existing Responsive fixes */
@media (max-width: 991.98px) {
  #sidebar-wrapper {
    margin-left: -280px;
    position: fixed;
    height: 100vh;
  }
  #wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
  }
  #page-content-wrapper {
    padding: 1rem;
  }
  .main-navbar {
    margin-bottom: 0px;
    height: 60px;
    padding: 0 1rem;
  }
  .content-container-inner {
      padding: 1.5rem 1rem;
  }
  .card-header {
    padding: 1rem;
  }
}

/* Premium Dashboard Tabs - Global */
.nav-pills .nav-link {
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.1, 1);
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1.25rem !important;
}

.nav-pills .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--secondary-ytd);
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: 0 10px 25px rgba(242, 93, 7, 0.2);
}

.tab-container-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 100px;
    padding: 0.75rem;
    display: inline-flex;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.tab-container-glass::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  
  .content-grid-small {
    grid-template-columns: 1fr !important;
  }

  .tab-container-glass {
    border-radius: 20px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
  }
  
  .nav-pills {
    flex-wrap: nowrap !important;
  }
  
  .nav-pills .nav-link {
    white-space: nowrap;
  }
}
