/* Custom CSS for BPCC Calamvale */

/* These variables will be overridden by inline styles from PHP */
:root {
  --theme-color: #1a535c;
  --accent-color: #ff6b6b;
  --bg-color: #f8f9fa;
}

/* Apply background color */
body {
  background-color: var(--bg-color);
}

/* Apply theme color to navbar and buttons */
.navbar {
  background-color: var(--theme-color) !important;
}

.btn-success {
  background-color: var(--theme-color) !important;
  border-color: var(--theme-color) !important;
}

.btn-success:hover {
  background-color: var(--theme-color) !important;
  border-color: var(--theme-color) !important;
  opacity: 0.9;
}

.bg-success {
  background-color: var(--theme-color) !important;
}

/* Apply accent color */
.text-accent {
  color: var(--accent-color) !important;
}

a {
  color: var(--accent-color);
}

a:hover {
  color: var(--accent-color);
  opacity: 0.8;
}

/* Additional styling */
.card {
  border: 1px solid rgba(0,0,0,0.125);
  border-radius: 0.375rem;
}

.footer {
  background-color: var(--theme-color);
  color: white;
  padding: 20px 0;
}

/* Sticky Sidebar Layout */
.main-wrapper {
  position: relative !important;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
}

.sponsor-sidebar {
  width: 20%;
  position: fixed;
  top: 95px; /* Adjust based on navbar height */
  height: calc(100vh - 95px); /* Subtract header height */
  overflow: hidden;
  padding: 10px 5px;
  z-index: 10;
}

.left-sidebar {
  order: 1;
  left: 0;
}

.main-content {
  width: 60%;
  order: 2;
  min-width: 0; /* Prevent flex item from overflowing */
  padding: 20px;
  margin-left: 20%; /* Space for left sidebar */
  margin-right: 20%; /* Space for right sidebar */
  margin-top: 10px; /* Space for header */
  min-height: calc(100vh - 80px); /* Minimum height to fill viewport */
}

.right-sidebar {
  order: 3;
  right: 0;
}

.sidebar-content {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 10px;
}

.sidebar-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--theme-color);
  font-size: 16px !important;
  font-weight: 800;
}

/* Sponsor Card Styles */
.sponsor-card {
  position: relative;
  margin-bottom: 5px;
  margin-top: 5px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.5s ease; /* Slower transition for smoother effect */
  width: 100%;
  height: 140px; /* Fixed height for all cards */
}

.sponsor-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.sponsor-item {
  display: none;
  padding: 0;
  margin: 0;
  text-align: center;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: opacity 0.8s ease, transform 0.5s ease; /* Slower, smoother transitions */
}

.sponsor-item.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.sponsor-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
}

.sponsor-logo {
  width: 300px;
  height: calc(100% - 4px);
  object-fit: contain;
  transition: transform 0.5s ease;
  border-radius: 8px;
  padding: 2px;
}

.sponsor-item:hover .sponsor-logo {
  transform: scale(1.02); /* Smaller, more subtle scale effect */
}

/* Hide description text but keep it for screen readers */
.sponsor-description {
  display: none;
}

/* Tooltip styles for description on hover */
.sponsor-item {
  position: relative;
}

.sponsor-item::after {
  content: attr(data-description);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  max-width: 200px;
}

.sponsor-item:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: -30px;
}

/* Arrow for tooltip */
.sponsor-item::before {
  content: '';
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.sponsor-item:hover::before {
  opacity: 1;
  visibility: visible;
  bottom: -20px;
}

/* Sponsor Indicators */
.sponsor-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: rgba(0,0,0,0.03);
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: all 0.5s ease; /* Slower transition for smoother effect */
}

.indicator.active {
  background: var(--theme-color);
  transform: scale(1.2); /* Slightly larger active indicator */
}

.indicator:hover {
  background: var(--accent-color);
  transform: scale(1.1);
}

/* Responsive Design - Tablet (1200px and below) */
@media (max-width: 1200px) {
  .sponsor-sidebar {
    width: 22%;
    padding: 15px 8px;
  }
  
  .main-content {
    width: 56%;
    margin-left: 22%;
    margin-right: 22%;
    padding: 15px;
  }
}

/* Responsive Design - Medium Tablet (992px - 768px) */
@media (max-width: 992px) and (min-width: 769px) {
  /* Header adjustments for medium tablets */
  .navbar {
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .navbar-brand img {
    height: 45px;
    width: auto;
  }
  
  /* Medium tablet layout with enhanced spacing */
  .main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    margin-top: 15px;
  }
  
  /* Left Sidebar - Enhanced for medium tablets */
  .left-sidebar {
    order: 1;
    width: 100%;
    position: static;
    height: auto;
    padding: 10px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  }
  
  /* Main Content - Enhanced for medium tablets */
  .main-content {
    order: 2;
    width: 100%;
    margin: 0;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  }
  
  /* Right Sidebar - Enhanced for medium tablets */
  .right-sidebar {
    order: 3;
    width: 100%;
    position: static;
    height: auto;
    padding: 10px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  }
  
  /* Vertical card layout for medium tablets */
  .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 15px;
    overflow-y: auto;
    scroll-behavior: smooth;
  }
  
  .sponsor-card {
    width: 100%;
    height: 200px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.12);
  }
  
  .sidebar-title {
    font-size: 15px !important;
    margin-bottom: 10px;
    text-align: center;
    color: var(--theme-color);
    font-weight: 750;
  }
  
  .sponsor-logo {
    width: 300px;
    height: 180px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 2px 0;
  }
}

/* Responsive Design - Large Tablet (992px and below) */
@media (max-width: 992px) {
  /* Header adjustments */
  .navbar {
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .navbar-brand img {
    height: 50px;
    width: auto;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
  }
  
  /* Main layout restructure with new order */
  .main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    margin-top: 10px;
  }
  
  /* Left Sidebar - Order 1 (First after header) */
  .left-sidebar {
    order: 1;
    width: 100%;
    position: static;
    height: auto;
    overflow: visible;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Main Content - Order 2 (Second) */
  .main-content {
    order: 2;
    width: 100%;
    margin: 0;
    height: auto;
    overflow: visible;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }
  
  /* Right Sidebar - Order 3 (Third) */
  .right-sidebar {
    order: 3;
    width: 100%;
    position: static;
    height: auto;
    overflow: visible;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Tablet sidebar layout - vertical cards */
  .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
  }
  
  .sidebar-content::-webkit-scrollbar {
    width: 6px;
  }
  
  .sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  
  .sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
  
  .sponsor-card {
    width: 100%;
    height: 200px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .sidebar-title {
    font-size: 14px !important;
    margin-bottom: 15px;
    text-align: center;
    color: var(--theme-color);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .sponsor-logo {
    width: 300px;
    height: 180px;
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    padding: 2px 0;
  }
}

/* Mobile Design - 768px and below */
@media (max-width: 768px) {
  /* Header styling for mobile */
  .navbar {
    padding: 0.5rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .navbar-brand img {
    height: 40px;
    width: auto;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-link:last-child {
    border-bottom: none;
  }
  
  /* Main wrapper with enhanced mobile styling */
  .main-wrapper {
    padding: 10px;
    gap: 20px;
    display: flex;
    flex-direction: column;
  }
  
  /* Left Sidebar - Order 1 (First after header) */
  .left-sidebar {
    order: 1;
    width: 100%;
    position: static;
    height: auto;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(26, 83, 92, 0.1), rgba(26, 83, 92, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(26, 83, 92, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  }
  
  /* Main content - Order 2 (Second) */
  .main-content {
    order: 2;
    width: 100%;
    margin: 0;
    height: auto;
    padding: 20px 15px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  /* Right Sidebar - Order 3 (Third) */
  .right-sidebar {
    order: 3;
    width: 100%;
    position: static;
    height: auto;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(26, 83, 92, 0.1), rgba(26, 83, 92, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(26, 83, 92, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  }
  
  /* Mobile sidebar layout - vertical stack with enhanced spacing */
  .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 15px;
  }
  
  .sponsor-card {
    width: 100%;
    height: 200px;
    margin-bottom: 0;
    position: relative;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
  }
  
  .sponsor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  }
  
  .sponsor-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
  }
  
  .sponsor-item.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .sponsor-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 15px;
  }
  
  .sponsor-logo {
    width: 300px;
    height: 180px;
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    padding: 2px 0;
    margin: auto;
  }
  
  .sponsor-item:hover .sponsor-logo {
    transform: scale(1.02);
  }
  
  .sidebar-title {
    font-size: 16px !important;
    margin-bottom: 20px;
    text-align: center;
    color: var(--theme-color);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
  }
  
  /* Enhanced mobile indicators */
  .sponsor-indicators {
    padding: 20px 15px;
    gap: 12px;
    background: linear-gradient(135deg, rgba(26, 83, 92, 0.1), rgba(26, 83, 92, 0.05));
    border-radius: 0 0 15px 15px;
  }
  
  .indicator {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 50%;
    background: rgba(26, 83, 92, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
  }
  
  .indicator.active {
    background: var(--theme-color);
    transform: scale(1.4);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(26, 83, 92, 0.3);
  }
  
  .indicator:hover {
    background: var(--accent-color);
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.7);
  }
  
  /* Enhanced mobile tooltips */
  .sponsor-item::after {
    font-size: 0.75rem;
    max-width: 200px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Animation for auto-slide */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateX(10px);
  }
  to { 
    opacity: 1; 
    transform: translateX(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sponsor-item.fade-in {
  animation: fadeIn 0.8s ease-out; /* Slower, smoother fade */
}

.sponsor-item.slide-in {
  animation: slideIn 0.6s ease-out;
}

/* Responsive animations - slower on mobile for better UX */
@media (max-width: 768px) {
  .sponsor-item.fade-in {
    animation: fadeIn 1s ease-out; /* Even slower on mobile */
  }
  
  .sponsor-item.slide-in {
    animation: slideIn 0.8s ease-out;
  }
  
  /* Ensure indicators are visible and touchable on mobile */
  .sponsor-indicators {
    padding: 15px 10px; /* More padding for easier touch */
    gap: 10px; /* Larger gap between indicators */
  }
  
  .indicator {
    width: 12px; /* Larger indicators for touch */
    height: 12px;
    min-width: 12px; /* Prevent shrinking */
    min-height: 12px;
  }
  
  .indicator.active {
    transform: scale(1.3); /* More prominent active state */
  }
}