/* Custom Font Declaration */
@font-face {
    font-family: 'Bebas Neue';
    src: url('https://static.igem.wiki/teams/5836/fonts/bebasneue/bebasneue-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves loading performance */
}

@font-face {
    font-family: 'Noto Serif Display';
    src: url('https://static.igem.wiki/teams/5836/fonts/noto-serif-display/notoserifdisplay-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves loading performance */
}

@font-face {
    font-family: 'Blinker';
    src: url('https://static.igem.wiki/teams/5836/fonts/blinker/blinker-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves loading performance */
}

/* OpenDyslexic Font for Accessibility */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://static.igem.wiki/teams/5836/fonts/opendyslexic/opendyslexic-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body { 
    padding-top: 90px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

html {
    overflow-x: hidden; /* Also prevent on html element */
}

.left-aligned { margin-left: auto; }

.bg-dark, .navbar, .dropdown-menu {
    background-color: #6E0D25 !important;
}

.navbar {
    min-height: 80px;
    font-family: 'Blinker', serif !important; /* Apply custom font to navbar */
}

.navbar-nav .nav-link,
.navbar-brand-custom,
.navbar-brand-custom img,
.dropdown-item {
    color: #fff !important;
    font-size: 1.7rem;
    font-weight: 500;
    font-family: 'Blinker', serif !important; /* Apply custom font to all navbar text */
}

.navbar-brand-custom img {
    height: 75px;
    padding: 0;
    vertical-align: middle;
    transition: transform 0.3s ease;
    margin: -5px 0; /* Negative margin to make logo bigger without affecting navbar height */
}

.navbar-brand-custom:hover img {
    transform: scale(1.1); /* Make logo slightly bigger on hover */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.dropdown-item:hover,
.dropdown-item:focus {
    color: #D7AF6B !important;
    background-color: transparent !important;
}

.dropdown-menu {
    border: none;
    background-color: #6E0D25 !important;
    font-family: 'Blinker', serif !important;
    right: auto;
    left: auto;
}

/* Align dropdown right border with nav link right border */
.navbar-nav .nav-item:last-child .dropdown-menu,
.navbar-nav .nav-item:nth-last-child(1) .dropdown-menu,
.navbar-nav .nav-item:nth-last-child(2) .dropdown-menu {
    right: 0 !important; /* Align to right edge of parent nav-item */
    left: auto !important;
    transform: none; /* Remove any transforms */
    margin-right: 0; /* Remove any margins */
}

/* Remove the conflicting media query rules */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        max-width: calc(100vw - 40px);
        box-sizing: border-box;
    }
    
    /* Ensure perfect alignment for rightmost dropdowns */
    .navbar-nav .nav-item:nth-last-child(-n+2) .dropdown-menu {
        right: 0 !important;
        left: auto !important;
        margin-right: 0; /* No additional margin needed */
        transform: none; /* No transform needed */
    }
}

.dropdown-item {
    color: #fff !important;
    font-family: 'Blinker', serif !important; /* Apply custom font to dropdown items */
    white-space: nowrap; /* Prevent text wrapping */
    padding: 8px 20px; /* Adjust padding if needed */
}

/* Show dropdown on hover */
.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

/* Remove focus outline for nav links */
.nav-link:focus {
    outline: none;
}

/* Awards Link Wave Glow Animation */
.awards-link {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #fff 0%, #fff 45%, #d7af6b 50%, #fff 55%, #fff 100%);
    background-size: 400% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff !important;
    font-family: 'Blinker', serif !important;
    font-size: 1.7rem !important;
    font-weight: 500 !important;
    letter-spacing: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: text-wave-glow 5s infinite;
}

.awards-link:hover,
.awards-link:focus {
    background: #d7af6b !important;
    -webkit-text-fill-color: #d7af6b !important;
    color: #d7af6b !important;
    animation: none;
}

@keyframes text-wave-glow {
    0% {
        background-position: 0% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* CALLOUT */
.bd-callout { padding:1.25rem; margin-top:1.25rem; margin-bottom:1.25rem; border:1px solid #e9ecef; border-left-width:.25rem; border-radius:.25rem }
.bd-callout h4 { margin-bottom: 1.25rem }
.bd-callout p:last-child { margin-bottom:0 }
.bd-callout code { border-radius:.25rem }
.bd-callout+.bd-callout { margin-top:-.25rem }
.bd-callout-info { border-left-color:#5bc0de }
.bd-callout-warning { border-left-color:#f0ad4e }
.bd-callout-danger { border-left-color:#d9534f }

/* footer */
footer a { color: white; font-weight: bold; text-decoration: none; }
footer a:hover { color: white; text-decoration: underline; }

/* Footer Styles */
footer.bg-dark {
    margin-top: 0 !important;
    background-color: #0b1320 !important;
}

/* Footer Logo Section */
.footer-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-team-logo {
    height: 150px; /* Increased from 80px */
    width: auto;
}

/* Social Media Icons */
.footer-social-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto; /* Remove fixed width */
    height: auto; /* Remove fixed height */
    background-color: transparent; /* Remove background */
    border-radius: 0; /* Remove circular border */
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none; /* Remove border */
}

.social-icon:hover {
    background-color: transparent; /* Keep background transparent on hover */
    color: white; /* Keep color unchanged */
    border-color: transparent; /* Keep border transparent */
    transform: scale(1.2); /* Scale up on hover instead of translateY */
    text-decoration: none;
}

/* Styling for SVG social icons */
.social-icon-svg {
    width: 32px; /* Increased from 24px */
    height: 32px; /* Increased from 24px */
    filter: brightness(0) invert(1); /* Make SVG icons white */
    transition: transform 0.3s ease; /* Changed from filter transition to transform */
}

.social-icon:hover .social-icon-svg {
    transform: scale(1.2); /* Scale up the icon on hover */
}

/* Sponsors Grid - Desktop: 2x6 grid */
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Mobile: 6x2 grid */
@media (max-width: 768px) {
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
        max-width: 300px;
        gap: 0.8rem;
    }
}

/* Sponsor link styling */
.sponsor-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #afc1d0;
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    border: 2px solid transparent;
    min-height: 60px;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Sponsor logo styling */
.sponsor-logo {
    max-width: 120%;
    max-height: 120%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Hover effect - 20% scale increase */
.sponsor-link:hover .sponsor-logo {
    transform: scale(1.2);
}

.sponsor-link:hover {
    background-color: #98b3c7;
    border-color: #D7AF6B;
    transform: translateY(-2px);
}

/* Placeholder styling */
.sponsor-placeholder {
    color: #0b1320;
    font-weight: bold;
    font-size: 0.8rem;
}

.placeholder-text {
    text-align: center;
    line-height: 1.2;
    font-family: 'Raleway', sans-serif;
}

.sponsor-placeholder:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Footer Contact Info */
.footer-contact-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.footer-university {
    color: white;
    font-size: 0.9rem;
    margin: 0.3rem 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Center the bottom footer section */
.row.mt-4 .col {
    text-align: center;
}

.row.mt-4 .col p {
    text-align: center;
    margin: 0 auto;
}

/* Ensure the links maintain proper styling when centered */
.row.mt-4 .col a.subfoot {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.row.mt-4 .col a.subfoot:hover {
    color: white;
    text-decoration: underline;
}

/* Mobile adjustments for centered footer text */
@media (max-width: 768px) {
    .row.mt-4 .col p {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .row.mt-4 .col p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .footer-logo-section {
        margin-bottom: 2rem;
    }
    
    .footer-team-logo {
        height: 60px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
        max-width: 250px;
        gap: 0.75rem;
    }
    
    .sponsor-link {
        padding: 0.4rem;
    }
    
    .footer-contact-info {
        margin-bottom: 1rem;
    }
    
    .footer-email,
    .footer-website {
        font-size: 0.8rem;
    }
    
    .footer-website {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-social-icons {
        gap: 0.75rem;
    }
    
    .social-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .sponsors-grid {
        max-width: 200px;
        gap: 0.5rem;
    }
}

/* Accessibility Button */
.accessibility-button {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.accessibility-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    opacity: 0.7;
}

.accessibility-link:hover {
    opacity: 1;
    transform: scale(1.1);
    text-decoration: none;
}

.accessibility-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .accessibility-button {
        right: 15px;
    }
    
    .accessibility-icon {
        width: 60px; /* Doubled from 30px to 60px */
        height: 60px; /* Doubled from 30px to 60px */
        filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
    }
}

/* Accessibility Menu */
.accessibility-menu {
    position: fixed;
    top: 0;
    right: -100vw; /* Completely hide off-screen */
    width: 25vw;
    min-width: 300px;
    height: 100vh;
    background-color: #6E0D25;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: right 0.4s ease;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.accessibility-menu.show {
    right: 0;
}

.accessibility-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.accessibility-menu-title {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
    margin: 0;
}

.accessibility-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.accessibility-menu-close:hover {
    color: #D7AF6B;
    transform: scale(1.1);
}

.accessibility-option {
    background-color: #D7AF6B;
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.accessibility-option:hover {
    background-color: #E5C17F;
    transform: translateY(-2px);
}

.accessibility-option-text {
    font-family: 'OpenDyslexic', sans-serif;
    color: white;
    font-size: 1.5rem;
    font-weight: normal;
    margin: 0;
}

/* Mobile responsive for accessibility menu */
@media (max-width: 768px) {
    .accessibility-menu {
        width: 40vw;
        min-width: 280px;
        right: -100vw; /* Completely hide off-screen on mobile */
        padding: 1.5rem;
    }
    
    .accessibility-menu.show {
        right: 0;
    }
    
    .accessibility-menu-title {
        font-size: 1.3rem;
    }
    
    .accessibility-option-text {
        font-size: 1rem;
    }
}

/* Extra small devices (phones) */
@media (max-width: 480px) {
    .accessibility-menu {
        width: 50vw;
        min-width: 250px;
        right: -100vw; /* Completely hide off-screen */
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .accessibility-menu {
        width: 30vw;
        min-width: 320px;
        right: -100vw; /* Completely hide off-screen */
    }
}

.cont {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .cont {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .cont {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .cont {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .cont {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .cont {
    max-width: 1320px;
  }
}

/* Additional navbar-specific fixes */
.navbar .cont {
  display: flex;
  flex-wrap: inherit;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 991.98px) {
  .navbar .cont {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .navbar-collapse {
    width: 100%;
    flex-basis: 100%;
    order: 3;
  }
  
  .navbar-brand {
    order: 1;
  }
  
  .navbar-toggler {
    order: 2;
  }
}

/* OpenDyslexic Accessibility Mode */
body.accessibility-mode *,
body.accessibility-mode .navbar-nav .nav-link,
body.accessibility-mode .navbar-brand-custom,
body.accessibility-mode .dropdown-item,
body.accessibility-mode .navbar,
body.accessibility-mode .reference,
body.accessibility-mode .reference-link,
body.accessibility-mode .references-section,
body.accessibility-mode .references-section p,
body.accessibility-mode .references-list,
body.accessibility-mode .references-list li,
body.accessibility-mode ol.references-list,
body.accessibility-mode ol.references-list li,
body.accessibility-mode .modal-title,
body.accessibility-mode .modal-content,
body.accessibility-mode .modal-description,
body.accessibility-mode .modal-description p,
body.accessibility-mode .modal-body,
body.accessibility-mode .card-modal,
body.accessibility-mode .card-modal *,
body.accessibility-mode .modal-content *,
body.accessibility-mode .modal-description *,
body.accessibility-mode .modal-body *,
body.accessibility-mode .ihp-panel__text,
body.accessibility-mode .ihp-panel__text p,
body.accessibility-mode .ihp-conclusion,
body.accessibility-mode .ihp-conclusion p,
body.accessibility-mode .ihp-conclusion h2,
body.accessibility-mode .ihp-overview,
body.accessibility-mode .ihp-overview li,
body.accessibility-mode .ihp-overview__intro,
body.accessibility-mode .ihp-overview__sublist,
body.accessibility-mode .ihp-overview__sublist li {
    font-family: 'OpenDyslexic', sans-serif !important;
}

/* Reduce font size for OpenDyslexic to prevent truncation */
body.accessibility-mode {
    font-size: 90% !important;
}

/* Make navbar text much smaller in OpenDyslexic mode */
body.accessibility-mode .navbar-nav .nav-link,
body.accessibility-mode .navbar-brand-custom,
body.accessibility-mode .dropdown-item {
    font-size: 0.85rem !important;
    letter-spacing: 0.02em !important;
}

/* Responsive navbar text for OpenDyslexic mode */
@media (max-width: 768px) {
    body.accessibility-mode .navbar-nav .nav-link,
    body.accessibility-mode .navbar-brand-custom,
    body.accessibility-mode .dropdown-item {
        font-size: 0.55rem !important;
        letter-spacing: 0.01em !important;
    }
}

@media (max-width: 480px) {
    body.accessibility-mode .navbar-nav .nav-link,
    body.accessibility-mode .navbar-brand-custom,
    body.accessibility-mode .dropdown-item {
        font-size: 0.5rem !important;
        letter-spacing: 0.01em !important;
    }
}