/* Apple Color Palette & Global Styles */
body {
    font-family: -apple-system, BlinkMacMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #1d1d1f;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.5s, color 0.5s;
}

body.dark-mode {
    background-color: #000000;
    color: #e8e8ed;
}


/* General Content Styling */
h1, h2, h3, h4 {
    font-family: -apple-system, BlinkMacMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    color: #1d1d1f;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 {
    color: #e8e8ed;
}

h1 {
    font-size: 2.8rem;
    text-align: center;
    margin-top: 0.5rem;
}

p {
    font-size: 1.1rem;
    line-height: 1.65;
    color: #333333;
    text-align: center;
    max-width: 800px;
    margin: 1rem auto 3rem auto;
}

body.dark-mode p {
    color: #cccccc;
}

/* Footer */
.footer {
    background-color: #f5f5f7;
    color: #6e6e73;
    padding: 20px;
    margin-top: auto;
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center horizontally */
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #6e6e73;
}

body.dark-mode .footer p {
    color: #86868b;
}

body.dark-mode .footer {
    background-color: #121212;
    color: #86868b;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    p { padding: 0 1rem; }
}

.dark-mode-switch {
  width: 60px;
  height: 30px;
  position: relative;
  display: inline-block;
  margin-top: 5px; /* Adjusted for vertical alignment */
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 30px;
}

.ball {
  position: absolute;
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ball .fa-sun {
  display: none;
  color: white;
}

.ball .fa-moon {
  display: block;
  color: black;
}

input:checked + .slider {
  background-color: #2997FF;
}

input:checked + .slider .ball {
  background-color: black;
  -webkit-transform: translateX(30px);
  -ms-transform: translateX(30px);
  transform: translateX(30px);
}

input:checked + .slider .ball .fa-sun {
  display: block;
}

input:checked + .slider .ball .fa-moon {
  display: none;
}

/* Gallery Specific Styles */
.gallery-container {
    padding: 10px;
}

/* Tabs Styling for Apple Aesthetic */
/* Corrected: Removed `justify-content: center` media query for always left-aligned tabs */
.nav-tabs {
    border-bottom: 1px solid #d2d2d7; /* Subtle bottom border */
    justify-content: flex-start; /* Default to flex-start for all screens */
    margin-bottom: 20px;
    flex-wrap: nowrap; /* Prevent tabs from wrapping */
    overflow-x: auto; /* Enable horizontal scrolling for tabs */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    background-color: #f5f5f7; /* Light background for tabs */
    border-radius: 10px; /* Rounded corners for the tab container */
    padding: 5px; /* Internal padding */
    position: relative; /* For scroll shadow */
}

#yearTab {
    margin-bottom: 10px; /* Reduced space after year tabs */
}

.tab-pane > .nav-tabs {
    margin-bottom: 10px; /* Reduced space after event tabs */
}

body.dark-mode .nav-tabs {
    border-bottom: 1px solid #424245; /* Darker border in dark mode */
    background-color: #1c1c1e; /* Dark background for tabs */
}

body.dark-mode .nav-tabs .nav-item {
    border-right: 1px solid #424245; /* Darker border in dark mode */
}

/* Scroll shadow for tabs */
.nav-tabs::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px; /* Width of the shadow */
    height: 100%;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
    pointer-events: none; /* Allow clicks through the shadow */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease-in-out;
}

body.dark-mode .nav-tabs::after {
    background: linear-gradient(to left, rgba(0,0,0,1), rgba(0,0,0,0));
}

.nav-tabs.scroll-right::after {
    opacity: 1; /* Show shadow if tabs are scrollable to the right */
}



/* Force visibility of nav items -- overriding any potential Bootstrap hiding */
/* This applies to the YEAR tabs and EVENT tabs */
.nav-tabs .nav-item {
    white-space: nowrap; /* Prevent tab text from wrapping */
    flex-shrink: 1; /* Allow items to shrink to fit */
    display: flex; /* Make li.nav-item a flex container */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    border-right: 1px solid #d2d2d7; /* Vertical separator line */
}

.nav-tabs .nav-item:last-child {
    border-right: none; /* Remove border from the last item */
}

.nav-tabs .nav-link {
    border: none; /* Remove default Bootstrap borders */
    border-radius: 7px; /* Slightly rounded corners for individual tabs */
    color: #6e6e73; /* Default text color */
    padding: .5rem 1rem; /* Increased horizontal padding for large screens */
    transition: all 0.2s ease-in-out; /* Smooth transitions */
    margin: 0 3px; /* Space between tabs */
    font-weight: 500; /* Slightly lighter font weight */
    background-color: transparent; /* Transparent background by default */
    position: relative;
    display: flex; /* Use flex for centering content */
    align-items: center;
    justify-content: center;
}

body.dark-mode .nav-tabs .nav-link {
    color: #86868b; /* Lighter text in dark mode */
}

.nav-tabs .nav-link:hover {
    color: #1d1d1f; /* Darker text on hover */
    background-color: #e8e8ed; /* Subtle background on hover */
}

body.dark-mode .nav-tabs .nav-link:hover {
    color: #e8e8ed; /* White text on hover in dark mode */
    background-color: #3a3a3c; /* Darker background on hover */
}

.nav-tabs .nav-link.active {
    color: #1d1d1f; /* Active tab text color */
    background-color: #ffffff; /* White background for active tab */
    font-weight: 600; /* Bolder for active tab */
    font-size: 1rem; /* Consistent font size */
    padding: .5rem .5rem; /* Consistent horizontal padding */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow for active tab */
}

body.dark-mode .nav-tabs .nav-link.active {
    color: #e8e8ed; /* White text for active tab in dark mode */
    background-color: #2c2c2e; /* Darker background for active */
    box-shadow: 0 1px 3px rgba(255,255,255,0.05); /* Subtle shadow for active tab */
}

.tab-content {
    padding: 10px 0;
}

/* Carousel specific styles */
.carousel-container {
    margin-bottom: 30px;
    /* border: 1px solid #e0e0e0; */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    width: 100%;
    height: 510px; /* Further increased default height for carousel */
}

body.dark-mode .carousel-container {
    border-color: #444;
    box-shadow: 0 4px 8px rgba(255,255,255,0.05);
}

.carousel-inner {
    height: 100%; /* Ensure carousel inner fills container */
}

.carousel-item {
    height: 100%; /* Ensure carousel item fills container */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure only active carousel item is displayed */
.carousel-item:not(.active) {
    display: none;
}

.carousel-item img {
    width: 100%; /* Image takes full width of its container */
    height: 100%; /* Image takes full height of its container */
    object-fit: contain; /* Ensures image fits without cropping, maintaining aspect ratio */
    background-color: #f0f0f0; /* Placeholder background */
}

body.dark-mode .carousel-item img {
    background-color: #000000;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    color: white;
}

.carousel-caption h5 {
    color: white;
}

/* Adjust carousel controls for visibility */
.carousel-control-prev,
.carousel-control-next {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.carousel-container:hover .carousel-control-prev,
.carousel-container:hover .carousel-control-next {
    opacity: 1;
    visibility: visible;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1); /* Make arrows visible on light backgrounds */
}

body.dark-mode .carousel-control-prev-icon,
body.dark-mode .carousel-control-next-icon {
    filter: invert(0); /* Make arrows visible on white image backgrounds in dark mode */
}

/* Responsive adjustments for h1 and carousel height */
/* Removed justify-content: center from media queries to enforce flex-start on all screens */
@media (max-width: 992px) {
    h1 { font-size: 2.2rem; }
    .carousel-container {
        height: 450px; /* Further increased height for tablets */
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .carousel-container {
        height: 400px; /* Further increased height for mobile */
    }
    .nav-tabs .nav-link {
        padding: .4rem .3rem; /* Reduced horizontal padding */
        font-size: 0.85rem; /* Reduced font size */
    }
    .nav-tabs .nav-link.active {
        font-size: 0.9rem; /* Reduced font size */
        padding: .4rem .3rem; /* Reduced horizontal padding */
    }
}

@media (max-width: 576px) {
    h1 { font-size: 1.8rem; }
    .carousel-container {
        height: 350px; /* Further increased height for very small screens */
    }
    .nav-tabs .nav-link {
        padding: .3rem .2rem; /* Reduced horizontal padding */
        font-size: 0.8rem; /* Reduced font size */
    }
    .nav-tabs .nav-link.active {
        font-size: 0.85rem; /* Reduced font size */
        padding: .3rem .2rem; /* Reduced horizontal padding */
    }
    .carousel-control-prev, .carousel-control-next {
        width: 10%; /* Make controls wider for easier tapping */
    }
    .carousel-control-prev-icon, .carousel-control-next-icon {
        font-size: 1.5rem; /* Larger icons */
    }
}
