:root {
  --install-bg: #ffffff;
  --install-text: #333333;
  --install-border: var(--primary-border-dark);
}

.clickable {
  cursor: pointer !important;
}

.text-green {
  color: #198754;
}

.text-blue {
  color: #0d6efd;
}

.text-red {
  color: #dc3545;
}

.text-primary-color {
  color: var(--primary-color);
}

.text-underlined {
  text-decoration: underline !important;
}

.no-underline {
  text-decoration: none !important;
}

/* App Styles*/
body.loading {
  display: none;
  visibility: hidden;
  pointer-events: none;
}

body.hidden {
  visibility: hidden;
}

body {
  font-family: "Raleway", sans-serif !important;
  margin: 0;
  background-color: #f4f4f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333333;
}

main {
  width: 100%;
}

/* Sticky Header Styles */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Ensure the header stays on top */
  width: 100%;
}

.navbar .logo {
  height: 50px;
  width: 50px;
}

.navbar h1 {
  margin: 0;
  margin-top: 10px;
  font-size: 1.5rem;
  text-align: left;
  border-bottom: 1px solid black;
}

.navbar-collapse {
  justify-content: flex-end;
}

.navbar a,
.navbar i {
  color: #333333;
}

.navbar .subtitle {
  font-size: 1rem;
  text-align: left;
  padding-top: 4px;
}

.navbar-toggler {
  border: none !important;
  box-shadow: none !important;
  outline: none;
  padding: 0;
}

.event-title {
  display: flex;
  align-items: center;
  font-weight: bold;
}

.event-title-link,
.title-link {
  text-decoration: none;
  font-weight: 500;
  color: inherit;
}

.event-title-link:hover,
.title-link:hover {
  text-decoration: underline;
}

.event-type-icon {
  width: 30px;
  height: 30px;
  color: black;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  margin-right: 10px;
  flex-shrink: 0;
}

footer {
  width: 100%;
  position: sticky;
  bottom: 0;
  z-index: 999;
}

footer .container {
  justify-content: end;
}

#theme-icon {
  margin-right: 5px;
}

.footer-menu .nav-item a,
.header-menu .nav-item a {
  text-decoration: underline;
}

.info-section {
  margin-bottom: 30px;
}

.add-to-calendar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.add-to-calendar a {
  text-decoration: none;
  color: #6c757d;
}

.add-to-calendar a:hover {
  color: #343a40;
}

.card-footer a {
  color: var(--bs-secondary-color) !important;
}

.month-drop-down {
  min-width: 130px;
}

.social-links a {
  margin-right: 10px;
  font-size: 20px;
}

.round-border {
  border-radius: 0.375rem !important;
}

.events-count,
.list-count,
.table-count {
  text-align: center;
  min-width: 40px;
  display: inline-block;
  background-color: var(--secondary-color);
  color: white;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
}

#alert-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  transform: none;
  z-index: 9999;
  pointer-events: none;
  /* Prevent blocking clicks outside alert */
}

#alert-container .alert {
  border-radius: 0;
  margin: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  pointer-events: auto;

  /* Start hidden above */
  transform: translateY(-100%);
  opacity: 0;

  /* Smooth slide + fade */
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Slide in */
#alert-container .alert.showing {
  transform: translateY(0);
  opacity: 1;
}

/* Slide out */
#alert-container .alert.hiding {
  transform: translateY(-100%);
  opacity: 0;
}

.events-table-container {
  margin: 0 20px;
}

.text-red {
  color: #dc3545 !important;
}

.text-green {
  color: #198754 !important;
}

.text-left {
  text-align: left;
}

.content-left {
  justify-content: flex-start;
}

.content-right {
  justify-content: flex-end;
}

.blue-border-left {
  border-left: #0dcaf0 5px solid !important;
}

.green-border-left {
  border-left: #198754 5px solid !important;
}

.yellow-border-left {
  border-left: #ffc107 5px solid !important;
}

.red-border-left {
  border-left: #dc3545 5px solid !important;
}

.event-details a {
  color: #212529;
}

.event-details a:hover {
  color: #212529;
}

.section-title {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid gray;
  margin-bottom: 5px;
}

.no-events-message {
  margin-top: 20px;
  opacity: 0.85;
}

.no-events-message i {
  opacity: 0.85;
}

.contact-options {
  margin-top: 10px;
}

.contact-link {
  color: var(--secondary-color);
  text-decoration: underline;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Dark overlay */
  z-index: 9999;
  /* Above all content */
  display: none;
  /* Hidden by default */
}

#loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
}

table.table>tbody>tr:hover td,
table.table>tbody>tr:hover th {
  background-color: var(--secondary-color) !important;
}

/* AGE GATE */
#age-gate {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.age-gate-box {
  background-color: var(--card-bg, #fff);
  color: var(--text-color, #333);
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.age-gate-box h2 {
  margin-bottom: 1rem;
}

.age-gate-box p {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.age-gate-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 1.25rem;
}

.age-gate-buttons .btn-primary {
  background-color: #9F1D35;
  border-color: #9F1D35;
  color: #fff;
}

.age-gate-buttons .btn-primary:hover {
  background-color: #722f37;
  border-color: #722f37;
}

.age-gate-footer {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

.age-gate-footer a {
  color: var(--primary-color);
  text-decoration: underline;
}

/* COOKIE BANNER */
#cookie-banner {
  position: fixed;
  bottom: 45px;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 15px;
  text-align: center;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
}

#cookie-banner p {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  display: inline-block;
}

#cookie-banner a {
  color: var(--primary-color);
  text-decoration: underline;
}

#cookie-banner button {
  margin-left: 10px;
  background-color: var(--primary-color);
  border: none;
  padding: 5px 10px;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
}

/* PWA INSTALL BANNER */
.install-banner {
  position: fixed;
  bottom: 55px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 1050;
  padding: 10px 14px;
  border-radius: 10px;
  background-color: var(--install-bg);
  color: var(--install-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--install-border);
  transition: all 0.3s ease;
}

.install-banner #install-btn {
  background-color: var(--primary-color);
  color: #333;
  border: none;
  font-weight: bold;
  padding: 6px 12px;
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
}

.install-banner #dismiss-install {
  background: transparent;
  border: none;
  color: var(--install-text);
  font-size: 1.2rem;
  cursor: pointer;
}

.description-wrapper {
  max-height: 100px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.description-wrapper.expanded {
  max-height: none;
}

.more-toggle {
  display: inline-block;
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
}

.pre-wrap {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Base styling */
.view-toggle .btn {
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--primary-border-dark);
  background-color: transparent;
  color: var(--primary-color);
  transition: all 0.2s ease;
}

.view-toggle .btn:hover {
  background-color: var(--primary-color);
  color: #000;
}

.view-toggle .btn.active {
  background-color: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.admin-card {
  border: 1px solid #ddd;
  transition: box-shadow 0.2s;
}

.admin-card:hover {
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.admin-card img {
  max-height: 160px;
  object-fit: cover;
}

/* Ensure all admin cards are the same height */
.admin-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make sure the body expands to fill space and footer stays at bottom */
.admin-card .card-body {
  flex-grow: 1;
}

.admin-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  padding: 1rem;
  background-color: var(--bs-light);
}

.profile-image-floated {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1.5rem auto;
  /* Center on mobile */
  border: 5px solid #fff;
  /* White border */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  /* Optional depth */
}

.profile-image-floated {
  float: left;
  margin: 0 20px 1.5rem 0;
}

/* Light Mode Styles */
body {
  background-color: #f4f4f9;
  /* Light background */
  color: #333;
  /* Darker text color */
}

header {
  background-color: #e0e0e0;
  /* Light gray header */
  color: #333;
  /* Darker text for light mode */
}

.navbar .navbar-brand h1,
.navbar .navbar-brand h2 {
  color: #333;
  /* Ensure dark text in header for light mode */
}

.navbar {
  background-color: #e0e0e0;
  /* Light background for navbar */
}

footer {
  background-color: #f9f9f9;
  /* Light footer for light mode */
  color: #333;
  /* Dark text for footer in light mode */
}

.footer-menu,
.header-menu {
  align-items: center;
}

.footer-menu a,
.header-menu a,
.footer-menu p,
.header-menu p {
  color: #333;
}

.footer-menu a:hover,
.header-menu a:hover {
  color: #000;
}

/* Calendar Light Mode */
.calendar-grid .month {
  background-color: #fff;
  /* Light background for month blocks */
  color: #333;
  border: 1px solid #ccc;
  /* Light border */
}

.week-header {
  background-color: #e0e0e0;
  /* Light header for days */
  color: #333;
}

.event-type-icon {
  border: 1px solid #333;
}

.month.current-month {
  border: 2px solid #333;
}

.day {
  background-color: #f9f9f9;
  /* Light background for days */
  color: #333;
  /* Dark text */
  border-color: #ddd;
}

.event-day {
  background-color: #ffec9e;
  /* Highlight event day */
}

.today-day {
  border: 2px solid rgb(0, 0, 0) !important;
}

.disabled-month,
.disabled-day {
  background-color: #f0f0f0;
  color: #999;
}

/* Modal Styles */
.accordion-button {
  background-color: #f9f9f9 !important;
}

.modal-subtitle {
  color: var(--bs-secondary-color);
}

.offcanvas {
  max-width: 85%;
}

.offcanvas .nav-link {
  width: 100%;
  color: var(--bs-secondary-color);
}

.offcanvas a.nav-link:hover {
  color: black;
  font-weight: 600;
}

.table td a {
  text-decoration: none;
}

.table th {
  text-align: center;
  vertical-align: middle;
}

.view-toggle .btn.active {
  pointer-events: none;
  opacity: 0.8;
}

#logoFilePreview img,
#profileImageFilePreview img {
  max-width: 100%;
  height: auto;
  margin-top: 0.5rem;
  border-radius: 4px;
}

.line-clamp-3 {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Styles Dashboard - Events */
.event-card,
.host-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-card:hover,
.host-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

/* Secondary */
body.dark-mode .alert.alert-secondary {
  background-color: #2c2c2c;
  /* dark grey */
  color: #e0e0e0;
  border-color: #444;
}

/* Info */
body.dark-mode .alert.alert-info {
  background-color: #1f3a4d;
  /* deep muted blue */
  color: #d6e9f9;
  border-color: #355a72;
}

/* Primary */
body.dark-mode .alert.alert-primary {
  background-color: #223a5e;
  /* navy */
  color: #d6e0f5;
  border-color: #335080;
}

/* Success */
body.dark-mode .alert.alert-success {
  background-color: #1e402e;
  /* deep green */
  color: #d4f5e2;
  border-color: #2f6247;
}

/* Warning */
body.dark-mode .alert.alert-warning {
  background-color: #4a3b1f;
  /* muted brownish yellow */
  color: #fff2cc;
  border-color: #806a3f;
}

/* Danger */
body.dark-mode .alert.alert-danger {
  background-color: #4a1f1f;
  /* deep muted red */
  color: #f8d7da;
  border-color: #803f3f;
}

/* Light */
body.dark-mode .alert.alert-light {
  background-color: #3a3a3a;
  /* slightly lighter grey than secondary */
  color: #f1f1f1;
  border-color: #555;
}

/* Dark */
body.dark-mode .alert.alert-dark {
  background-color: #1a1a1a;
  /* near black */
  color: #e0e0e0;
  border-color: #333;
}

/* Ensure links & close buttons are visible */
body.dark-mode .alert a {
  color: #aad4ff;
  font-weight: 500;
}

body.dark-mode .alert .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.7;
}

.event-date-circle {
  aspect-ratio: 1 / 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #444;
  color: white;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 2px 0;
}

body.dark-mode .event-date-circle {
  background-color: #333;
  color: #fff;
}

.title-event-day,
.title-event-city {
  font-weight: bold;
  font-size: 1rem;
  line-height: 1;
}

.title-event-month {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  line-height: 1;
}

.calendar-month-header {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.calendar-arrow {
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.calendar-arrow:hover {
  color: #ffc857;
}

.td-100,
.btn-100 {
  min-width: 100px !important;
}

.td-125,
.btn-125 {
  min-width: 125px !important;
}

.td-150,
.btn-150 {
  min-width: 150px !important;
}

.td-200,
.btn-200 {
  min-width: 200px !important;
}

.td-250,
.btn-250 {
  min-width: 250px !important;
}

.nowrap {
  white-space: nowrap;
}

#confirmationModalContent {
  border: none;
  /* remove default border */
  border-left: 4px solid transparent;
  /* space for accent */
  border-radius: 0.375rem;
  /* preserve Bootstrap’s rounded corners */
}

#confirmationModalContent.border-primary {
  border-left-color: var(--bs-primary);
}

#confirmationModalContent.border-success {
  border-left-color: var(--bs-success);
}

#confirmationModalContent.border-warning {
  border-left-color: var(--bs-warning);
}

#confirmationModalContent.border-danger {
  border-left-color: var(--bs-danger);
}

#backToTopBtn {
  position: fixed;
  bottom: 55px;
  right: 10px;
  width: 44px;
  height: 44px;
  opacity: 0;
  transform: translateY(20px);
  /* start slightly below */
  z-index: 999;
  transition: opacity 0.3s ease, transform 0.3s ease;
  background-color: whitesmoke;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  display: flex;
  /* keep flex for centering */
}

#backToTopBtn.show {
  opacity: 0.8;
  transform: translateY(0);
  /* slide into place */
  pointer-events: auto;
}

#backToTopBtn.show:hover {
  opacity: 1;
}

body.dark-mode #backToTopBtn {
  background-color: #333;
  color: #fff;
}

.month-title .badge {
  min-width: 35px;
}

/* Modal image — maintain aspect ratio, no stretch */
#imageModal .modal-dialog {
  max-width: 95%;
  width: auto;
}

#imageModal img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 90vh;
  height: auto;
  width: auto;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  /* ensures no stretching */
}

/* Position the close button relative to the viewport */
#imageModal .image-close-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  filter: invert(1) brightness(2);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  z-index: 1060;
  transition: all 0.2s ease;
}

#imageModal .image-close-btn::before {
  content: "✕";
  font-weight: 600;
  color: #fff;
  font-size: 1.2rem;
}

.view-example-link {
  font-size: 0.9rem;
  color: var(--bs-primary);
  font-weight: 500;
  text-decoration: none;
  display: block;
  margin-top: 10px;
}

.view-example-link:hover {
  text-decoration: underline;
}

.breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
}

.breadcrumb-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.breadcrumb-item:last-child {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  /* critical for flex truncation to work */
}

/* Keeps posters consistent even if original images vary in size */
.img-fluid.rounded {
  aspect-ratio: 2/3;
  object-fit: cover;
}

/* Featured Blog Section */
.featured-blog-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.featured-blog-title-link:hover {
  text-decoration: underline !important;
}

.btn-outline-wine {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-wine:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.featured-blog-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  position: relative;
}

.featured-card-badge {
  position: absolute;
  top: 10px;
  right: -6px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px 3px 8px;
  border-radius: 4px 0 0 4px;
  z-index: 2;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.featured-blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  color: inherit;
}

.featured-blog-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.featured-blog-card-body {
  padding: 0.75rem 1rem;
}

.featured-blog-card-body h6 {
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.featured-blog-card-body p {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 0;
  line-height: 1.4;
}

/* Quick Link Cards */
.quick-link-card {
  padding: 0.6rem 0.5rem;
}

.quick-link-body i {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
  display: block;
}

.quick-link-body h6 {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0;
}