/* Custom Properties for easy color changes */
:root {
  --brand-yellow: #e3ff00;
  --dark-bg: #0a0a0a;
  --card-bg: #161616;
  --text-main: #ffffff;
  --text-dim: #a0a0a0;
  --max-width: 1400px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--dark-bg);
  color: var(--text-main);
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Montserrat', sans-serif; letter-spacing: 1px; }

/* Fixed Background */
.bg-fixed {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  z-index: -1;
  background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('images/485868887_655852943694573_7254049274930066578_n.jpg');
  background-size: cover;
  background-position: center;
}

/* --- FIX 1: MODERN HEADER LAYER --- */
header {
  position: sticky; 
  top: 0; 
  z-index: 9999; /* Higher z-index to stay on top */
  background: rgba(10, 10, 10, 0.95); /* More solid background */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #333;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%; 
}

.nav-links {
    list-style: none !important;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px; 
}

.logo-group { display: flex; align-items: center; gap: 12px; }
.logo-box { background: var(--brand-yellow); color: #000; font-weight: 800; padding: 8px 12px; border-radius: 4px; }

nav ul { display: flex; list-style: none; gap: 25px; }
nav a { text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 1.1rem; transition: 0.3s; }
nav a:hover, nav a.active { color: var(--brand-yellow); }

.fb-header-link {
    color: #ffffff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    text-decoration: none;
}

.fb-header-link:hover {
    color: var(--brand-yellow);
}

@media (max-width: 1024px) {
    .support-group {
        display: none !important;
    }
}

/* Hero Section */
.hero {
  height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
}

.hero h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); margin-bottom: 1rem; color: var(--brand-yellow); }
.hero p { max-width: 700px; font-size: 1.2rem; color: var(--text-dim); }

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.3s;
  margin-top: 2rem;
}
.btn-primary { background: var(--brand-yellow); color: #000; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(227, 255, 0, 0.2); }

/* Content Sections */
section { padding: 80px 20px; width: 100%; display: flex; justify-content: center; }
.container { max-width: var(--max-width); width: 100%; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; text-align: center; }
.stat-card { background: var(--card-bg); padding: 40px; border-radius: 8px; border-bottom: 3px solid var(--brand-yellow); }
.stat-card h3 { font-size: 2.5rem; color: var(--brand-yellow); }

/* Logo Grid */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 50px;
}

.logo-item {
  background: white;
  aspect-ratio: 3/2;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  overflow: hidden; 
  padding: 10px; 
}

.logo-item img { 
  width: 80%; 
  height: 80%;
  object-fit: contain; 
  display: block;
}

/* MOBILE VIEW FIX */
@media (max-width: 768px) {
    .logo-group { gap: 8px; }
    .logo-box { padding: 4px 8px; }
    .logo-box img { height: 30px; width: auto; }
    .logo-text { font-size: 0.9rem; line-height: 1.1; white-space: nowrap; }
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 10px 15px;
        overflow: hidden; 
    }
}

.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 20px;
  justify-content: center;
}

.flip-card {
  perspective: 1000px;
  width: 320px; 
  height: 300px; 
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden; 
  border: 1px solid #333;
}

.flip-card-front {
  background: var(--card-bg);
  border-bottom: 4px solid var(--brand-yellow);
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  padding: 0; 
}

.card-img {
  width: 100%;
  height: 200px; 
  object-fit: cover;
  display: block;
}

.flip-card-front h3 {
  color: var(--brand-yellow);
  padding: 15px 5px;
  margin: auto 0; 
  font-size: 1.2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.flip-card-back {
  background: var(--brand-yellow);
  color: #000;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.flip-card-back h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.flip-card-back ul {
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.4;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px; 
}

.header-logo {
    height: 50px; 
    width: auto;  
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    letter-spacing: 0.5px;
    border-left: 1px solid #444; 
    padding-left: 15px;
}

footer {
  background: #050505;
  padding: 60px 20px;
  border-top: 1px solid #222;
  display: flex;
  justify-content: center; 
  width: 100%;
}

.footer-container {
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 10px;
  width: 100%;
}

/* --- FIX 2: TITLE LAYER --- */
h2 {
    position: relative;
    z-index: 1; /* Stay behind the header floor */
    margin-top: 60px;   
    margin-bottom: 20px; 
    color: var(--brand-yellow); 
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.event-card {
    background: var(--card-bg);
    border: 1px solid #222;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 20px;
    transition: transform 0.2s ease;
}

.event-card:hover {
    border-color: var(--brand-yellow);
    transform: translateX(5px);
}

.event-date {
    background: #222;
    color: var(--brand-yellow);
    min-width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-weight: 800;
    margin-right: 25px;
}

.event-date .day { font-size: 1.8rem; line-height: 1; }
.event-date .month { font-size: 0.8rem; text-transform: uppercase; }

.event-details { flex-grow: 1; }
.event-details h3 { font-size: 1.2rem; color: var(--text-main); margin-bottom: 5px; }
.event-details .location { color: var(--brand-yellow); font-size: 0.9rem; font-weight: 600; margin-bottom: 5px; }
.event-details .description { color: var(--text-dim); font-size: 0.85rem; max-width: 600px; }

.status-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge.training { background: #333; color: #fff; }
.status-badge.event { background: var(--brand-yellow); color: #000; }
.status-badge.charity { background: #d40000; color: #fff; }

@media (max-width: 600px) {
    .event-card { flex-direction: column; align-items: flex-start; text-align: left; }
    .event-date { margin-bottom: 15px; width: 100%; height: auto; padding: 10px; flex-direction: row; gap: 10px; }
    .event-status { margin-top: 15px; }
}

.bento-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 240px; 
    grid-auto-flow: dense; 
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--card-bg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.gallery-item.large { grid-column: span 2; grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }
.gallery-item.tall { grid-row: span 2; }

.gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.7);
}

.overlay {
    position: absolute;
    bottom: -50px; 
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--brand-yellow);
    font-weight: 700;
    font-size: 0.9rem;
    transition: bottom 0.3s ease;
}

.gallery-item:hover .overlay {
    bottom: 0; 
}

@media (max-width: 600px) {
    .bento-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }
    .gallery-item.large, .gallery-item.wide { grid-column: span 2; }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px;
}

.form-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #222;
    display: flex;
    flex-direction: column;
}

.form-item label {
    color: var(--brand-yellow);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.form-item input, .form-item textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    color: #fff;
    padding: 10px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-item textarea {
    height: 100%; 
    resize: none;
}

.form-item input:focus, .form-item textarea:focus {
    border-color: var(--brand-yellow);
}

.btn-primary-form {
    background: var(--brand-yellow);
    color: #000;
    border: none;
    padding: 15px 50px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary-form:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(227, 255, 0, 0.3);
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
}

.about-hero-image {
    width: 100%;
    max-width: var(--max-width); 
    margin: 0 auto 20px auto;   
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.about-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.image-caption {
    background: rgba(0, 0, 0, 0.7);
    color: var(--brand-yellow);
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* --- THE SYMMETRY FIX --- */
.split-layout {
    display: flex;
    gap: 40px; 
    align-items: flex-start; /* Keeps headers aligned at the top */
    padding: 40px 0;
    width: 100%;
}

.content-side, .map-side { 
    flex: 1 1 50%; /* Force exactly 50% width each */
    max-width: 50%; 
}

/* Ensure both headers start at the same height */
.content-side h2, .map-side h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    text-align: center;
}

.map-side {
    background: rgba(10, 10, 10, 0.4) !important;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #222;
    /* Vertically center the map if the text side is long */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
}

/* Force the 4 cards into a neat 2x2 grid within their 50% half */
.content-side .flip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 15px;
    margin: 30px 0;
    justify-items: center;
}

/* Adjust card size to fit the 50% container comfortably */
.flip-card {
    perspective: 1000px;
    width: 100%; /* Fill the grid cell */
    max-width: 280px; 
    height: 280px;
    cursor: pointer;
}

/* Responsive: Stack them on mobile */
@media (max-width: 1100px) {
    .split-layout { flex-direction: column; }
    .content-side, .map-side { 
        max-width: 100%; 
        width: 100%; 
    }
    .content-side .flip-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.content-side .flip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.map-wrapper {
    width: 100%;
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

#ireland-map {
    width: 100%;
    height: auto;
    max-height: 600px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}



.content-side ul { list-style: none; margin-top: 20px; }
.content-side ul li { position: relative; padding-left: 30px; margin-bottom: 15px; }
.content-side ul li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-yellow); font-weight: bold; }

@media (max-width: 1100px) {
    .split-layout { flex-direction: column; padding: 40px 15px; }
    .content-side, .map-side { width: 100%; flex: none; }
    .map-side { margin-top: 50px; }
}

/* Tooltip Styling */
.header-tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #111;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 1001;
    top: 150%; 
    right: 0; 
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--brand-yellow);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    pointer-events: none; 
}

.header-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%; 
    right: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--brand-yellow) transparent;
}

.header-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 1024px) {
    .header-tooltip .tooltiptext { display: none !important; }
}

.region-group:hover path {
    fill: var(--brand-yellow); 
    stroke: #000;
    stroke-width: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-group path {
    fill: #383737; 
    stroke: #b8b6b6;
    stroke-width: 1px;
    transition: all 0.3s ease;
}

#map-tooltip {
    background: var(--brand-yellow);
    color: #000;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    white-space: nowrap;
	position: fixed; 
    pointer-events: none; 
    z-index: 9999;
    display: none; 
}

.modal {
    display: none; 
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9); 
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    border: 2px solid var(--brand-yellow);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--brand-yellow);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #fff;
    padding: 20px 0;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.month-cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--brand-yellow);
    padding: 15px 5px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.month-cell span { font-weight: bold; font-size: 0.9rem; color: var(--brand-yellow); }
.month-cell small { font-size: 0.65rem; opacity: 0.7; margin-top: 5px; }

.month-detail-view {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--brand-yellow);
    transition: opacity 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.month-title {
    color: var(--brand-yellow);
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.month-cell:active { transform: scale(0.95); background: var(--brand-yellow); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.month-cell.active-month {
    background: var(--brand-yellow) !important;
    color: black !important;
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.month-cell.active-month span,
.month-cell.active-month small { color: black !important; }

.calendar-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
}

.btn-calendar-toggle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ffffff;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif; 
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 500px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-calendar-toggle:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--brand-yellow);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-calendar-toggle:active { transform: translateY(0); background: var(--brand-yellow); color: #000; }

.form-item.auto-expand { grid-column: span 2; }

.form-item textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    color: #fff;
    padding: 10px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    min-height: 45px; 
    overflow-y: hidden; 
    resize: none; 
}

/* Ensure the section allows the inner container to go wide */
.calendar-section {
    width: 100%;
    display: flex;
    justify-content: center;
    background: transparent; /* The section is clear, the container is black */
}

/* Base style for the black box */
#calendar-container {
    width: 95%; /* Falls back to 95% of screen width if below max-width */
    transition: max-width 0.4s ease-in-out;
}

@media (max-width: 768px) {
    #calendar-container {
        padding: 20px 10px !important; /* Reduces the 50px padding to 10px */
        border-radius: 0 !important;   /* Goes edge-to-edge for more space */
        border: none !important;
    }
    
    /* Ensure the table itself doesn't feel cramped */
    #event-table th, #event-table td {
        padding: 12px 8px !important; 
        font-size: 0.8rem !important;
    }

    /* Keep the status badge small so it doesn't wrap */
    .status-badge {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
    }
}

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 5px; }
.menu-toggle span { display: block; width: 25px; height: 3px; background-color: var(--brand-yellow); border-radius: 2px; transition: all 0.3s ease; }

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

@media (max-width: 768px) {
    /* Set sticky for mobile header consistency */
    header { position: sticky; top: 0; z-index: 9999; }
    .nav-container { display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 15px; }
    .nav-container .btn-primary { order: 2; font-size: 0.75rem !important; padding: 6px 12px !important; margin: 0 10px; }
    .menu-toggle { display: flex; order: 3; z-index: 1001; }
    .nav-links {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 15, 15, 0.98);
        padding: 20px 0;
        border-bottom: 3px solid var(--brand-yellow);
        z-index: 1000;
    }
    .nav-links.active { display: flex; }
    .nav-links li { margin: 15px 0; text-align: center; }
    .hero h1 { font-size: 1.8rem; }
    .stats-grid, .logo-grid, .flip-grid { grid-template-columns: 1fr !important; display: flex !important; flex-direction: column; align-items: center; gap: 20px; }
    .flip-card { width: 100%; max-width: 300px; height: 320px; }
    .form-item.auto-expand { grid-column: span 1; }
    .logo-group { order: 1; flex: 1; justify-content: flex-start; }
    .logo-text { font-size: 0.8rem; }
}

.fb-header-link {
    color: #ffffff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.fb-header-link:hover { color: #e3ff00; }
.header-actions { margin-left: 15px; }


/* Ensure the ID matches what JS creates */
#popup-item {
    position: fixed;
    z-index: 99999;
    transition: transform 0.6s ease-out;
    pointer-events: none;
    height: 350px; /* Slightly taller to make sure torso shows */
    width: auto;
}

/* 1. HIDDEN POSITIONS (Off-screen) */
/* Added rotate(180deg) to the 'from-top' base state so he's already upside down */
#popup-item.from-bottom { bottom: 0; left: 50%; transform: translate(-50%, 100%); }
#popup-item.from-top    { top: 0; left: 50%; transform: translate(-50%, -100%) rotate(180deg); } 
#popup-item.from-left   { left: 0; top: 50%; transform: translate(-100%, -50%) rotate(90deg); }
#popup-item.from-right  { right: 0; top: 50%; transform: translate(100%, -50%) rotate(-90deg); }

/* 2. ACTIVE POSITIONS (Peeking in) */

/* Bottom Peek: Slides UP into view */
#popup-item.from-bottom.active { 
    transform: translate(-50%, 10%) !important; 
}

/* Top Peek: Slides DOWN into view while STAYING upside down */
#popup-item.from-top.active { 
    transform: translate(-50%, -10%) rotate(180deg) !important; 
}

/* Side Peeks: Sliding in while staying rotated sideways */
#popup-item.from-left.active { 
    transform: translate(-10%, -50%) rotate(90deg) !important; 
}
#popup-item.from-right.active { 
    transform: translate(10%, -50%) rotate(-90deg) !important; 
}

/* ==========================================================================
   BENELLI EASTER EGG EFFECTS
   ========================================================================== */

/* 1. THE MAIN BIKE MOVEMENT */
@keyframes driveLeft {
    from { left: 100%; }
    to { left: -1600px; } 
}

/* 2. SMOKE PARTICLE BASE STYLING (Desktop First) */
.smoke-particle {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 2147483648 !important; 
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0) 70%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block !important;
    animation: launch 4s ease-out forwards;
}

/* 3. SMOKE PARTICLES WITH TEXT */
.smoke-particle.with-text {
    background: none !important;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    font-family: "Arial Black", sans-serif;
    font-size: 24px;
    font-weight: 900;
    white-space: nowrap;
    width: auto; height: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* 4. DESKTOP ANIMATION */
@keyframes launch {
    0% { transform: translate(0, 0) scale(0.2); opacity: 0; }
    15% { opacity: 0.7; }
    100% { transform: translate(var(--drift), -350px) scale(3.5); opacity: 0; }
}

/* 5. MOBILE OVERRIDES (768px and below) */
@media (max-width: 768px) {
    .smoke-particle {
        width: 20px !important;
        height: 20px !important;
        background: rgba(255, 255, 255, 0.9) !important;
        /* Force use of mobile animation to break out of center-containers */
        animation: launchMobile 2.5s ease-out forwards !important;
    }

    .smoke-particle.with-text {
        font-size: 14px !important;
    }

    @keyframes launchMobile {
        0% { 
            transform: translate(0, 0) scale(0.5) !important; 
            opacity: 0; 
        }
        20% { 
            opacity: 0.8; 
        }
        100% { 
            /* The -150px Y-axis shift forces it to float UP */
            transform: translate(var(--drift), -150px) scale(2.2) !important; 
            opacity: 0; 
        }
    }
}

/* 6. PREVENT HORIZONTAL SCROLL */
body {
    overflow-x: hidden !important;
}

/* Custom wide grid for Testimonials - FORCED 3 COLUMNS */
.wide-grid {
    display: grid;
    /* Forces exactly 3 columns on desktop */
    grid-template-columns: repeat(3, 1fr); 
    gap: 40px; 
    align-items: stretch; 
}

/* Adjust for medium screens (Tablets/Laptops) */
@media (max-width: 1200px) {
    .wide-grid {
        grid-template-columns: repeat(2, 1fr); /* Drop to 2 columns so they don't get squished */
    }
}

/* Adjust for Mobile */
@media (max-width: 768px) {
    .testimonials-section .container {
        padding: 40px 20px !important;
        width: 100% !important;
        border-radius: 0; /* Full width look on mobile */
    }
    
    .wide-grid {
        grid-template-columns: 1fr; /* Stacked 1-high on mobile */
        gap: 25px;
    }
}

/* Final polish for the cards themselves */
.testimonials-section .stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222;
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in a row are the same height */
    text-align: left; /* Keeps long quotes readable */
}

@media (max-width: 768px) {
    /* 1. Remove padding from the outer section entirely */
    .testimonials-section {
        padding: 0 !important; 
        margin: 0 !important;
        width: 100vw; /* Force it to the viewport width */
    }

    /* 2. Make the container fill 100% of the screen width */
    .testimonials-section .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 40px 20px !important; /* This padding is INSIDE the black, keeping text off the edge */
        background: rgba(10, 10, 10, 0.98) !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* 3. Ensure the grid doesn't restrict width */
    .wide-grid {
        display: block !important;
        width: 100% !important;
    }

    /* 4. The cards (now just text blocks) */
    .testimonials-section .stat-card {
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid #222 !important;
        padding: 30px 0 !important; /* Vertical spacing between reviews */
        margin: 0 !important;
        width: 100% !important;
    }

    /* 5. Typography tweaks for the "Edge-to-Edge" look */
    .testimonials-section h2 {
        font-size: 1.6rem !important;
        text-align: left !important;
        margin-bottom: 30px !important;
    }

    .testimonials-section .stat-card p {
        font-size: 1.1rem !important;
        line-height: 1.5;
        padding-right: 5px; /* Tiny bit of safety for the text */
    }
}

#motorbike-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    pointer-events: none;
    display: none; 
    perspective: 1200px;
}

#popup-motorbike {
    display: block;
    max-height: 85vh;
    width: auto;
    
    /* 1. Remove opacity: 0; Set it to solid 1 */
    opacity: 1 !important; 
    
    /* 2. Start at scale 0 (a tiny dot in the center) */
    transform: scale(0) rotateX(5deg); 
    
    /* 3. Transition ONLY the transform (the movement), not the opacity */
    transition: transform 3.5s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    
    /* Ensure no weird ghosting happens */
    backface-visibility: hidden;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5));
}

/* The "Arrived" State */
#popup-motorbike.active {
    opacity: 1 !important; /* Keep it solid */
    transform: scale(1.1) rotateX(0deg); 
}

/* THE BLINDING OVERLAY - LOCKED CENTER */
.blinding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    display: flex;
    justify-content: center; /* Centers the whole light group horizontally */
    align-items: center;     /* Centers the whole light group vertically */
}

/* Individual light "cores" */
.light-source {
    position: absolute;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(255,255,255,1) 0%, 
        rgba(255,255,255,0.9) 30%, 
        rgba(255,255,255,0) 70%);
    filter: blur(30px);
    mix-blend-mode: screen;
    transform-origin: center center; /* Forces growth from the middle */
}

/* POSITIONING THE 4 LIGHTS 
   Using 'margin' or 'translate' to offset from the center 
   instead of 'top/left' prevents the "sideways drift" during scaling.
*/
.l1 { transform: translate(-45%, 1%); }  /* Top Left */
.l2 { transform: translate(8%, -5%); }   /* Top Right */
.l3 { transform: translate(-12%, 8%); width: 35vw; height: 35vw; } /* Bottom Left */
.l4 { transform: translate(12%, 8%); width: 35vw; height: 35vw; }  /* Bottom Right */

/* THE ANIMATION SEQUENCE - REMOVED HORIZONTAL MOVEMENT */
#headlight-flash.flashing {
    animation: intenseGlow 1.8s ease-in-out 2;
}

@keyframes intenseGlow {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    15% { 
        opacity: 1; 
        transform: scale(1.1); 
    } /* The "Snap" to white */
    80% { 
        opacity: 1; 
        transform: scale(1.2); 
    } /* Hold it steady */
    100% { 
        opacity: 0; 
        transform: scale(1.5); 
    } /* Fade out while expanding straight forward */
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.featured-card {
    background: rgba(25, 25, 25, 0.8);
    border: 1px solid #333;
    border-top: 4px solid var(--brand-yellow);
    padding: 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.featured-card:hover {
    transform: translateY(-10px);
    background: rgba(35, 35, 35, 0.95);
    border-color: var(--brand-yellow);
    box-shadow: 0 15px 35px rgba(0,0,0,0.7);
}

.featured-card h4 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.15rem;
}

.featured-card p {
    color: #bbb;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* YouTube/Facebook standard 16:9 ratio */
.video-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9; 
    border: none;
}

/* Instagram specific ratio (usually square or 4:5) */
.video-container.instagram-reel iframe {
    aspect-ratio: 1 / 1.2; 
    max-width: 450px;
    margin: 0 auto;
    display: block;
}