/* ================= GLOBAL STYLES ================= */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    min-height: 100%;
    background: radial-gradient(circle, #1f1f1f, #000000, #880202); /* Theme Background */
    color: white;
}

/* ================= NAVBAR ================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(to right, black, #eb0028);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
}

.navbar .logo {
    display: flex;
    align-items: center;
}

.navbar .logo img {
    height: 55px;
    margin-right: 10px;
}

.navbar ul {
    display: flex;
    list-style: none;
    margin: -10px;
    padding: 30px;
}

.navbar ul li {
    margin: 0 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.navbar ul li a:hover, .navbar ul li a.active {
    color: rgb(0, 0, 0);
}

/* ================= EVENTS SECTION ================= */
  .events-section {
    margin-top: 120px; /* Space for fixed navbar */
    padding: 40px 5%;
  }

  .section-heading {
    font-size: 80px; /* Huge font like screenshot */
    font-weight: 800;
    color: #eb0028; /* TEDx Red */
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -2px;
  }

  /* The Description Text Box */
  .events-description-box {
    background: #1a1a1a; /* Dark grey background */
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #333;
    margin-bottom: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    max-width: 900px;
  }

  .events-description-box p {
    color: #e0e0e0;
    font-size: 20px;
    line-height: 1.6;
    margin: 0;
  }

  /* The Image Gallery Grid */
  .events-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 20px;
    margin-bottom: 80px;
  }

  /* Gallery item as a pure image holder (no links, no overlays) */
  .gallery-item {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* Consistent, modern YouTube-style shape */
    border: 2px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    /* Base subtle border to enable glow focus */
    box-shadow: 0 0 0 rgba(235, 0, 40, 0);
    background: #0d0d0d; /* Dark fallback under images */
  }

  /* Images fill and crop elegantly without distortion */
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Avoid unexpected gaps */
    /* No scale on hover per requirement; keep steady */
    transition: opacity 0.25s ease;
  }

  /* Hover-only glow on the border; no play button */
  .gallery-item:hover {
    border-color: #eb0028; /* TEDx Red glow */
    box-shadow:
      0 0 18px rgba(235, 0, 40, 0.45),
      0 0 6px rgba(235, 0, 40, 0.35);
  }

  /* Optional: Slight image emphasis via opacity on hover (keeps shape, no zoom) */
  .gallery-item:hover img {
    opacity: 0.98;
  }

  /* Remove default figure spacing across browsers */
  .gallery-item {
    margin: 0;
  }

  /* Responsive adjustments: stack to 2 columns on medium screens, 1 on small */
  @media (max-width: 1024px) {
    .events-gallery {
      grid-template-columns: repeat(2, 1fr);
    }
    .section-heading {
      font-size: 64px;
      letter-spacing: -1px;
    }
  }

  @media (max-width: 640px) {
    .events-gallery {
      grid-template-columns: 1fr;
    }
    .section-heading {
      font-size: 44px;
      letter-spacing: 0;
    }
    .events-description-box {
      padding: 24px;
    }
    .events-description-box p {
      font-size: 18px;
    }
  }
/* ================= PAST TALKS SECTION ================= */
.past-talks-section {
    padding: 40px 5% 80px;
}

.talks-heading {
    font-size: 48px;
    font-weight: 800;
    color: white;
    margin-bottom: 20px;
}

/* Filter Buttons */
.talks-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 50px; /* Pill shape */
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-btn.active {
    background-color: #eb0028;
    color: white;
}

.filter-btn:not(.active) {
    background-color: #333;
    color: #aaa;
}

.filter-btn:not(.active):hover {
    background-color: #444;
    color: white;
}

/* Talks Grid */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns like screenshot */
    gap: 30px;
}

/* Video Card */
.talk-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

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

/* Play Button on Thumbnail */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
}

.thumbnail-container:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
}

/* Video Duration Badge */
.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* Talk Text Info */
.talk-info {
    display: flex;
    flex-direction: column;
}

.talk-meta {
    font-size: 10px;
    color: #aaa; /* Light grey for metadata */
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.speaker-name {
    font-size: 18px;
    font-weight: 800; /* Very bold like screenshot */
    color: white;
    margin: 0;
    line-height: 1.2;
}

/* Responsive */
@media (max-width: 900px) {
    .events-gallery, .talks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-heading { font-size: 60px; }
}

@media (max-width: 600px) {
    .events-gallery, .talks-grid {
        grid-template-columns: 1fr;
    }
    .talks-filters {
        flex-wrap: wrap;
    }
}

/* Footer Section Container */

.footer-section {
    position: relative;
    background: linear-gradient(to bottom, #330000, #000);
    color: white;
    padding: 50px 20px 0;
    text-align: center;
    
    /* CHANGE THIS LINE */
    overflow: visible; /* Was hidden - needs to be visible for popup to show */
}
.footer-bg-clipper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* CRITICAL for background */
    z-index: 0;
    pointer-events: none;
}

/* 3. Adjust the Animated Background to sit inside the clipper */
.animated-background {
    position: absolute;
    top: -50px; /* You can keep this, the clipper will hide the overflow part */
    left: -200px;
    width: 200%;
    height: 300px;
    background: radial-gradient(circle, #eb0028 60%, transparent 60%);
    animation: background 10s linear infinite;
    /* Remove z-index here, controlled by parent */
}

/* Footer Content Wrapper */
.footer-content {
    position: relative;
    z-index: 2;
}

/* Find this in your CSS and update it */
.footer-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    
    /* ADD THESE TWO LINES */
    position: relative; 
    z-index: 10; /* Ensures the popup sits on top of the next row */
}

.footer-box {
    text-align: center;
    position: relative;
}

.footer-underline {
    height: 2px;
    width: 80%;
    background: white;
    border-top: 2px dashed white;
    margin: 0 auto 20px;
}

/* Heading Links (if applicable) */
.footer-heading {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.footer-heading a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.footer-heading a:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Whitish transparent background */
}

/* --- SUBTEXT LINKS (Book Ticket / Contact Us) --- */
.footer-subtext {
    font-size: 16px;
    font-weight: 400;
    color: white;
}

.footer-subtext a {
    color: white !important; /* Force white text */
    text-decoration: none !important; /* No underline */
    padding: 5px 12px; /* Add padding so the background looks like a button */
    border-radius: 5px; /* Soft rounded corners */
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* Ensures padding works correctly */
}

/* THE HOVER EFFECT: White text + Translucent Background */
.footer-subtext a:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.15); /* The "whitish" background */
    backdrop-filter: blur(2px); /* Optional: adds a slight glass effect */
}

.footer-subtext .arrow {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff; /* Arrow stays red */
    margin-left: 5px;
}

/* Email Section */
.email-section {
    text-align: center;
}

.email-section p {
    font-size: 18px;
    margin-bottom: 20px;
}

.email-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.email-input {
    padding: 10px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    border: none;
    outline: none;
    border-bottom: 2px solid white;
    background: transparent;
    color: white;
    width: 300px;
}

.email-input::placeholder {
    color: white;
    opacity: 0.8;
}

.submit-button {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    background: white;
    color: red;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.submit-button:hover {
    background: red;
    color: white;
}

/* Footer Bottom */
.footer-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 30px;
}

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

.footer-left h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #e00227;
}

.footer-left p {
    font-size: 14px;
    color: white;
    margin: 5px 0;
}

.social-icons a img {
    width: 24px;
    margin-right: 10px;
    transition: transform 0.3s;
}

.social-icons a img:hover {
    transform: scale(1.2);
}

.footer-right ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.footer-right ul li {
    display: inline;
}

.footer-right ul li a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-right ul li a:hover {
    color: red;
}

.footer-right p {
    font-size: 14px;
    margin-top: 10px;
    color: white;
}

/* Animation Keyframes */
@keyframes background {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
/* --- CONTACT TOOLTIP STYLES --- */

/* 1. The Wrapper: anchors the absolute tooltip */
.contact-wrapper {
    position: relative; 
    display: inline-block;
    cursor: pointer;
}

/* 2. The Tooltip Box (Hidden by default) */
.contact-tooltip {
    position: absolute;
    bottom: 140%; /* Positions it above the text initially */
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* Start slightly lower for animation */
    
    width: 320px;
    padding: 25px;
    
    /* THE SHINY BLACKISH LOOK */
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.95), rgba(40, 0, 0, 0.9));
    backdrop-filter: blur(10px); /* Glass blur effect */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle top border */
    border-bottom: 2px solid #eb0028; /* TED Red accent at bottom */
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    
    /* Animation State: Hidden */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy effect */
    z-index: 100;
    pointer-events: none; /* Prevents clicking when hidden */
}

/* 3. The Hover Effect (Makes it appear) */
.contact-wrapper:hover .contact-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    bottom: 120%; /* Moves up slightly */
    pointer-events: auto; /* Enables clicking links inside */
}

/* Add a tiny triangle pointer at the bottom of the box */
.contact-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #eb0028 transparent transparent transparent; /* Red pointer */
}

/* --- TOOLTIP CONTENT STYLING --- */

.tooltip-content {
    text-align: left; /* Elegant alignment */
    font-family: 'Montserrat', sans-serif;
    color: white;
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.contact-row .icon {
    color: #eb0028; /* Red Icons */
    font-size: 18px;
}

.ted-link {
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted #eb0028;
    transition: color 0.3s;
}

.ted-link:hover {
    color: #eb0028;
}

/* Divider Line */
.tooltip-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    margin: 15px 0;
}

/* Thank You Message */
.thank-you-msg {
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: #ddd;
    line-height: 1.4;
}

.thank-you-msg .highlight {
    color: #eb0028;
    font-weight: 700;
    font-style: normal;
    text-transform: uppercase;
    font-size: 14px;
}
@media (max-width: 900px) {
    /* Navbar Stacking */
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .navbar ul {
        padding: 0;
        margin: 0;
        flex-wrap: wrap;
        justify-content: center;
    }
}
/* ================= RESPONSIVE FIXES (UPDATED) ================= */

/* Tablet View */
@media (max-width: 992px) {
    .team-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .navbar ul { flex-wrap: wrap; justify-content: center; gap: 15px; }
    
    body { padding-top: 160px; }
    
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .footer-row { flex-direction: column; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
    .footer-right ul { justify-content: center; flex-wrap: wrap; }

    /* Footer Background for Mobile */
    .animated-background {
        height: 100%; 
        width: 300%; 
        top: 0;
        left: -100%;
        border-radius: 0;
    }
}

/* Mobile Phones (400px - 480px) */
@media (max-width: 600px) {
    /* 1. Navbar: Big Logo Fix */
    .navbar { 
        padding: 15px 10px; 
        justify-content: center; /* Center items */
    }
    
    .navbar .logo { 
        flex-direction: row; /* Keep image and text side-by-side */
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .navbar .logo img { 
        height: 60px; /* Bigger Logo Image */
        margin-right: 15px;
    }

    /* Target the text specifically to make it BIGGER */
    .navbar .logo .tedx-text {
        font-size: 34px; /* Much Bigger font */
    }
    .navbar .logo .imi-delhi-text {
        font-size: 34px; /* Much Bigger font */
    }

    .navbar ul li { margin: 5px 10px; }
    .navbar ul li a { font-size: 15px; }

    /* 2. Body & Layout - PUSH CONTENT DOWN */
    body { 
        padding-top: 260px; /* Ensures the About box is visible below navbar */
    }
    
    .about-team-section { margin-top: 20px; padding: 0 10px; }
    
    .glassy-box { padding: 20px 15px; width: 100%; border-radius: 15px; }
    
    .animated-heading { font-size: 1.8rem; flex-direction: column; gap: 5px; }
    .about-content p { font-size: 1rem; }

    /* 3. Grid & Forms */
    .team-grid { grid-template-columns: 1fr; }
    .team-grid-section h1 { font-size: 2.2rem; }
    
    .email-form { flex-direction: column; width: 100%; }
    .email-input { width: 100%; margin-bottom: 10px; }
    .submit-button { width: 100%; }

    /* 4. Tooltip Fix */
    .contact-tooltip { width: 280px; left: 50%; transform: translateX(-50%); }
}