@import url('https://fonts.googleapis.com/css2?family=Tillana:wght@400;700&family=Outfit:wght@400;700&display=swap');

/* Setup Navigation and Structural Layout */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0;
}

.admin-tab {
  background: #eee;
  border: 1px solid var(--border-color);
  border-bottom: none;
  padding: 1.2rem 2rem;
  color: #555;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
  font-size: 1rem;
  flex: 1;
  text-align: center;
}

.admin-tab:hover {
  background: #e0e0e0;
  color: var(--primary-color);
}

.admin-tab.active {
  background: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  border-bottom: none;
}

.app-header {
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
}

.navbar-top {
  display: none;
  /* Hide redundant bar on desktop completely */
  padding: 0.5rem 1.5rem;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary-color);
  min-width: 48px;
  min-height: 48px;
}

.desktop-nav {
  display: flex;
  background-color: var(--navbar-bg);
  border-top: 1px solid var(--border-color);
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 0; /* Remove dead space below tabs */
}

.nav-link {
  padding: 0.4rem 0.8rem; /* Extra Slim from 0.6rem */
  color: #444;
  font-weight: 700;
  display: inline-block;
  min-height: 32px; /* Extra Slim from 38px */
  border-right: 1px solid #eee;
  transition: all 0.2s ease;
  position: relative;
  text-transform: uppercase;
  font-size: 0.8rem; /* Extra Slim from 0.85rem */
  letter-spacing: 0.3px;
}

.nav-link:last-child {
  border-right: none;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(232, 100, 12, 0.08); /* Slight transparent orange */
  text-decoration: none;
  color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--primary-color);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
  border-right: 1px solid #eee;
}

.dropbtn {
  background-color: transparent;
  color: #444;
  padding: 0.4rem 0.8rem; /* Extra Slim from 0.6rem */
  font-size: 0.8rem; /* Extra Slim from 0.85rem */
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  min-height: 32px; /* Extra Slim from 38px */
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.dropdown:hover .dropbtn,
.dropbtn:focus {
  background-color: rgba(232, 100, 12, 0.08); /* Slight transparent orange */
  color: var(--primary-color);
}

.dropdown:hover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--primary-color);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ffffff;
  min-width: 250px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid #eee;
}

.dropdown-content a:hover {
  background-color: rgba(232, 100, 12, 0.08); /* Sleek transparent orange */
  color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Nested Dropdown for 3rd level */
.nested-dropdown {
  position: relative;
}
.nested-dropdown-content {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background-color: #ffffff;
  min-width: 250px;
  box-shadow: 2px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 2;
  border-left: 1px solid #eee;
}
.nested-dropdown:hover .nested-dropdown-content {
  display: block;
}
.nested-dropdown a {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
}
.nested-dropdown a span {
  font-size: 0.7rem;
  opacity: 0.5;
}

/* Banner Section Enhancement */
.banner-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* CRITICAL: Anchor everything to the top line */
  padding: 4rem 1.5rem 0px 1.5rem; /* Balanced top padding */
  min-height: 460px; /* Reduced from 500px to fit second row of tabs on screen */
  background-color: #ffffff;
  border-bottom: 3px solid var(--primary-color);
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  gap: 10px;
}

.banner-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/murugan_banner_bg.png') no-repeat center center / cover;
  opacity: 0.65;
  /* Precision Integrated Solution: Single seamless artwork scaled within the image for zero cropping. */
  z-index: 0;
}

.banner-item {
  flex: 1;
  margin: 5px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.banner-item.left, 
.banner-item.right,
.banner-item.center {
  align-self: flex-end; /* All items at the bottom as requested */
  margin-bottom: 20px;
}

.banner-item.center {
  flex: 2;
}

.banner-item img {
  height: 132px; /* Base reference height */
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 2px solid white;
  transition: transform 0.3s ease;
}

.banner-item.left, 
.banner-item.right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0;
  padding-top: 20px; /* Adjusted anchor point for larger 420px banner */
  flex: 0 0 180px;
  align-self: flex-start; /* Lock both to the top edge */
}

/* Specifically target left and right portrait images only */
.banner-item.left img, 
.banner-item.right img {
  height: 210px !important; /* Made "little big" as requested */
  width: 160px; /* Fixed width for uniform look */
  object-fit: cover; /* Professional crop */
  object-position: top center;
  border: 4px solid white;
  margin: 0; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.banner-item img:hover {
  transform: scale(1.05);
}

.banner-title {
  color: var(--primary-color);
  font-size: 2.5rem; /* Reduced from 2.8rem to match smaller banner size */
  margin: 0;
  font-family: 'Tillana', cursive;
  font-weight: 700;
  letter-spacing: 1px;
  /* Black border/stroke for maximum visibility */
  -webkit-text-stroke: 1px #000;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.4);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-bottom: 1rem;
}

.banner-item p {
  font-size: 0.95rem;
  margin-top: 10px;
  font-weight: 700; /* Bold as requested */
  color: #333;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 2px rgba(255, 255, 255, 1);
  line-height: 1.4;
}

@media (max-width: 992px) {
  .banner-section {
    padding: 0 !important; /* Managed by navbar padding */
    margin-top: 60px !important; /* Space for the fixed floating menu */
    width: 100vw !important;
    margin-left: calc(-50vw + 50%);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 540px !important;
    background-position: center 30% !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Reorder: center title first, then left portrait, then right portrait */
  .banner-item.center { order: 1; }
  .banner-item.left { order: 2; }
  .banner-item.right { order: 3; }

  /* Portraits side by side on mobile */
  .banner-section {
    flex-wrap: wrap !important;
  }

  .banner-item.center {
    width: 100%;
    flex: 0 0 auto !important;
    margin-bottom: 2rem;
    z-index: 1;
  }

  /* ABSOLUTE PINNING: Places portraits in bottom corners regardless of screen width */
  .banner-item.left,
  .banner-item.right {
    position: absolute !important;
    bottom: 0px !important; /* Align to the same bottom line */
    width: 135px !important;
    height: 200px !important; /* Consistent container height for alignment */
    min-width: 0 !important;
    flex: none !important;
    margin: 0 !important;
    padding: 5px !important;
    z-index: 5 !important;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(2px);
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Aligns content (image) at the top */
  }

  .banner-item.left {
    left: 10px !important;
    right: auto !important;
  }

  .banner-item.right {
    right: 10px !important;
    left: auto !important;
  }

  .banner-title {
    font-size: 1.5rem !important;
    line-height: 1.2;
    -webkit-text-stroke: 0.5px #000;
  }

  .banner-item img {
    height: 100px !important;
    width: auto !important;
  }

  .banner-item.left img,
  .banner-item.right img {
    height: 110px !important;
    width: 85px !important;
    border: 2px solid white;
    object-fit: cover;
    margin-bottom: 5px !important;
  }

  .banner-item p {
    font-size: 0.7rem !important;
    max-width: 95%;
    margin: 4px auto 0;
    line-height: 1.3;
  }

  /* Hide the center logo on mobile to save space */
  .banner-item.center img {
    height: 50px !important;
    margin-top: 5px !important;
    margin-bottom: 2px !important;
  }

  .desktop-nav {
    display: none;
  }

  /* Global mobile card/container fixes */
  .container {
    padding: 0 1rem !important;
    margin-top: 80px !important; /* Space for the fixed floating menu + extra breathing room */
  }

  .card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  /* Audio cards - single column on mobile */
  .grid.grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
  }

  .audio-card {
    padding: 10px !important;
  }

  .audio-card h3 {
    font-size: 0.95rem !important;
  }

  /* Tables responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* PDF links list */
  .pdf-list {
    padding-left: 10px !important;
    font-size: 0.95rem !important;
  }

  /* Page headings */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.4rem !important; }
  h3 { font-size: 1.2rem !important; }

  /* Filter sections (songs page) */
  .filter-section {
    padding: 1rem !important;
    gap: 10px !important;
  }

  .search-box, .classify-box {
    min-width: 100% !important;
  }

  /* Export button */
  .export-btn {
    width: 100%;
    padding: 12px !important;
  }

  /* Grid collapse handled in style.css */
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  background-color: var(--navbar-bg);
  color: var(--text-color);
  border-top: 1px solid var(--border-color);
}

/* Mobile Sidebar Wrapper */
#mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: white;
  z-index: 2005;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

#mobile-sidebar.open {
  transform: translateX(0) !important;
  visibility: visible !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2004;
  backdrop-filter: blur(3px);
}

.sidebar-overlay.open {
  display: block;
}

.sidebar-header {
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  color: #555;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav li a,
.sidebar-nav li .sidebar-cat {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-color);
  font-weight: bold;
  font-size: 1.2rem;
}

.sidebar-nav li .sidebar-cat {
  background: #f9f9f9;
  cursor: pointer;
}

.sidebar-nav li a:hover {
  background: #f1f1f1;
  text-decoration: none;
}

.sub-nav {
  display: none;
  list-style: none;
  background: #fff;
  padding-left: 1.5rem;
}

.sub-nav.open {
  display: block;
}

@media (max-width: 960px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .navbar-top {
    display: flex;
    justify-content: flex-start;
    position: fixed; /* FLOATER: Stays on top as user scrolls */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 2003; /* High z-index to stay above everything */
    background-color: var(--navbar-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .events-sidebar-tab {
    display: block !important;
    font-size: 0.8rem;
    padding: 8px 15px;
  }
  
  /* Hide the floating tab when the sidebar is open to prevent clutter */
  #mobile-sidebar.open ~ .events-sidebar-tab {
    display: none !important;
  }
}

/* Mobile Nav CTA Styles */
.mobile-nav-cta-wrapper {
  background: var(--primary-color) !important;
  margin: 1rem !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-bottom: none !important;
}

.mobile-nav-cta {
  color: white !important;
  text-align: center;
  padding: 1.2rem !important;
  font-weight: 800 !important;
  font-size: 1.1rem !important;
  display: block;
  text-decoration: none;
  letter-spacing: 1px;
}

.mobile-nav-cta:hover {
  background: #d35400 !important;
}

/* Events Sidebar Tab & Mobile Floating Button */
.events-sidebar-tab {
  position: fixed;
  right: 0;
  top: 35%;
  transform: rotate(-90deg) translateY(0);
  transform-origin: bottom right;
  background-color: var(--primary-color);
  color: white;
  padding: 12px 30px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  z-index: 2003;
  font-weight: 800;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  letter-spacing: 2px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

@media (max-width: 960px) {
  .events-sidebar-tab {
    transform: none !important;
    bottom: 20px;
    right: 20px;
    top: auto;
    width: auto;
    height: auto;
    border-radius: 50px;
    padding: 15px 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1rem !important;
    letter-spacing: 1px;
    border: 2px solid white;
    font-weight: 900;
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 85px; /* Above the events button */
  right: 20px;
  background: white;
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 2003;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-color);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.events-sidebar-tab:active {
  background-color: #d35400;
}

.events-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: white;
  z-index: 2002;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 0;
}

.events-sidebar.open {
  transform: translateX(0);
}

@media (max-width: 992px) {
  .events-sidebar {
    width: 100%;
  }
}

.events-sidebar-content {
  padding: 20px;
}

.events-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--primary-color);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.events-sidebar-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.events-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.events-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.sidebar-event-card {
  background: #fff;
  border: 1px solid #eee;
  border-top: 4px solid var(--primary-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.sidebar-event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-event-card h4 {
  color: var(--primary-color);
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.sidebar-event-card .event-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.sidebar-event-card .event-meta i {
  margin-right: 5px;
}

.sidebar-event-card .event-meta strong {
  display: block;
  margin-bottom: 4px;
  color: #333;
}

.sidebar-event-card .event-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 15px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
}

.sidebar-event-card .event-link:hover {
  background: #d35400;
}

.sidebar-overlay-events {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2001;
  backdrop-filter: blur(2px);
}

.sidebar-overlay-events.open {
  display: block;
}

