:root {
    --primary-color: #ffffff;
    --secondary-color: #1a002b;
    --accent-color: #a200ff;
    --text-gray: #808080;
    --bg-dark: #1e1e1e;
    --bg-darker: #121212;
}

/* Performance optimization: Will-change hints for animated elements */
.logo,
.hamburger,
.back-to-top,
.slide {
    will-change: transform, opacity;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Bebas Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
    background-color: #000000;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

body {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--primary-color);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
                url('assets/opengripper.Still002.png') no-repeat;
    background-size: auto 130%;
    background-position: 69% 68%;
    filter: blur(3px) brightness(0.9);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
    z-index: -1;
}

nav {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    background: transparent;
    z-index: 100;
}

.team-name {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: clamp(1rem, 3vw, 1.5rem);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-links a.active {
    color: var(--primary-color);
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    flex: 1;
    justify-content: center;
    gap: 2rem;
}

.divider {
    width: 2px;
    height: 40px;
    background-color: var(--text-gray);
    margin: 0 0.5rem;
    display: block;
}

.info-sections {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.info-box {
    text-align: center;
    max-width: min(300px, 90vw);
    padding: 1rem;
}

.info-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    transition: color 0.3s ease;
    text-decoration: none;
    color: var(--primary-color);
}

.arrow {
    color: var(--text-gray);
    transition: all 0.3s ease;
}

.info-title:hover .arrow {
    transform: translateX(5px);
    color: var(--primary-color);
}

.info-description {
    color: var(--primary-color);
    line-height: 1.5;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-gray);
}

.slideshow-container {
    width: 100%;
    max-width: 540px;
    margin: 2rem 0;
    text-align: center;
}

.slideshow-container h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.slideshow {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slide.active {
    opacity: 1;
}

.slide img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}

.caption {
    padding: 10px;
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    text-align: center;
}

.slideshow-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: auto;
    transform: none;
    display: flex;
    gap: 10px;
    padding: 0;
}

.slideshow-controls button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 1rem;
    width: 40px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.slideshow-controls button:hover {
    background-color: rgba(162, 0, 255, 0.7);
}

.social-links {
    margin: 2rem 0;
    text-align: center;
}

.social-links h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.social-icon {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: transform 0.3s, background-color 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
    background-color: var(--accent-color);
}

.social-icon img {
    width: 30px;
    height: 30px;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.3);
    margin-top: 4rem;
    border-top: 1px solid rgba(162, 0, 255, 0.2);
}

footer p {
    margin-bottom: 0.5rem;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

footer .footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.85rem;
}

footer .footer-links a:hover {
    color: var(--accent-color);
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(162, 0, 255, 0.4);
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #8400d1;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(162, 0, 255, 0.6);
}

.back-to-top:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(162, 0, 255, 0.5);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Enhanced focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Content Section Styling */
.content-section {
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 720px;
    margin: 1rem 0;
}

.content-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.resource-link {
    display: block;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    transition: background-color 0.3s;
    min-width: 250px;
    text-align: center;
}

.resource-link:hover {
    background-color: var(--accent-color);
}

.youtube-section {
    width: 100%;
    max-width: 800px;
    margin: 2rem 0;
}

.youtube-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.team-member {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(162, 0, 255, 0.7);
}

.team-member-info {
    padding: 0.5rem;
}

.team-member-name {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.team-member-role {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.contact-form {
    width: 100%;
    max-width: 600px;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea,
.contact-form button {
    width: 100%;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #333;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
    font-size: 1rem;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button {
    background-color: var(--accent-color);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: #8400d1;
}

/* Media Queries */
@media (min-width: 768px) {
    nav {
        padding: 2rem;
        gap: 2rem;
    }

    .main-content {
        padding: 2rem;
        gap: 4rem;
    }
}

/* OPR Tool specific styling */
.tool-container {
    background-color: rgba(30, 30, 30, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1200px;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

select, input, button {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 16px;
    background-color: rgba(42, 42, 42, 0.8);
    color: var(--primary-color);
}

button {
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

button:hover {
    background-color: #8400d1;
}

.team-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    background-color: rgba(37, 37, 37, 0.8);
}

.team-rank {
    width: 40px;
    font-weight: bold;
    text-align: center;
}

.team-number {
    width: 80px;
    font-weight: bold;
}

.team-name {
    flex: 1;
}

.team-opr {
    width: 80px;
    text-align: right;
    font-weight: bold;
}

.opr-bar-container {
    flex: 2;
    background-color: #333;
    height: 20px;
    margin: 0 20px;
    border-radius: 10px;
    overflow: hidden;
}

.opr-bar {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 10px;
}

.highlighted {
    background-color: rgba(58, 34, 87, 0.8) !important;
    border-radius: 5px;
    padding: 5px;
    border-left: 3px solid var(--accent-color);
} 

.logo {
    width: 400px;
    height: auto;
    object-fit: contain;
}

.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 9999; 
  }
  
  .video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  body.video-hidden {
    overflow-y: auto;
  }
  
  /* Scroll Indicator Overlay */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--primary-color);
    animation: fadeIn 1s ease-out;
  }
  
  .scroll-indicator p {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  /* Bouncing arrow */
  .scroll-indicator .arrow {
    width: 30px;
    height: 30px;
    border-left: 4px solid var(--primary-color);
    border-bottom: 4px solid var(--primary-color);
    transform: rotate(-45deg);
    margin: 0 auto;
    animation: bounce 2s infinite;
  }
  
  /* Keyframes for the bounce animation */
  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0) rotate(-45deg);
    }
    40% {
      transform: translateY(10px) rotate(-45deg);
    }
    60% {
      transform: translateY(5px) rotate(-45deg);
    }
  }
  
  /* Optional: Fade in the scroll indicator on load */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Ensure the video container remains on top */
  .video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 9999;
  }

  .video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* If you had removed scrolling prevention, ensure scrolling is allowed */
  body {
    overflow-y: auto;
  }

  /* Mute Button Styling */
  .mute-btn {
    position: absolute;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
  }

  .mute-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.1);
  }

  .mute-btn .sound-off {
    display: none;
  }

  .mute-btn.muted .sound-on {
    display: none;
  }

  .mute-btn.muted .sound-off {
    display: block;
  }

  /* Video Play Overlay */
  .video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
  }

  .play-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
  }

  .play-btn:hover {
    transform: scale(1.1);
  }

  .play-btn svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  }

  .play-btn p {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }

  /* Stats Widget Styling */
  .stats-widget {
    width: 100%;
    max-width: 720px;
    margin: 2rem 0;
    padding: 2rem;
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    text-align: center;
  }

  .stats-widget h2 {
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .stats-loading {
    padding: 2rem;
    color: var(--text-gray);
    font-size: 1.1rem;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
  }

  .stat-card {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(162, 0, 255, 0.2);
  }

  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(162, 0, 255, 0.3);
  }

  .stat-label {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
  }

  .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
  }

  .stat-rank {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
  }

  .stat-rank span {
    color: var(--accent-color);
    font-weight: bold;
  }

  .stat-percentile {
    font-size: 0.85rem;
    color: var(--text-gray);
  }

  .stat-percentile span {
    color: var(--primary-color);
  }

  @media (max-width: 600px) {
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* Hamburger Menu */
  .hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    z-index: 1000;
    position: relative;
    /* Adjustable position variables for mobile - modify these values to move the button */
    /* Edit these in the @media (max-width: 768px) section below */
    --hamburger-top: 1rem;
    --hamburger-right: 1rem;
    /* Precise click area */
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 2.5px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Mobile Background */
  @media (max-width: 768px) {
    body::before {
      background-size: auto 120%;
      background-position: 52.5% 100%;
    }
  }

  /* Mobile Navigation */
  @media (max-width: 768px) {
    /* ============================================
       HAMBURGER MENU POSITION ADJUSTMENT
       ============================================
       To adjust the hamburger button position, change these values below:
       - top: controls vertical position (increase to move down, decrease to move up)
       - right: controls horizontal position (increase to move left, decrease to move right)
       
       Examples:
       - top: 0.5rem (closer to top)
       - top: 2rem (further from top)
       - right: 0.5rem (closer to right edge)
       - right: 2rem (further from right edge)
       ============================================ */
    
    nav {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      padding: 1rem;
      position: relative;
      flex-wrap: nowrap;
      /* Ensure nav doesn't block hamburger clicks */
      pointer-events: none;
      background: transparent;
      border: none;
      box-shadow: none;
    }
    
    nav > * {
      pointer-events: auto;
    }
    
    /* Hide nav-backdrop from nav children to prevent click interference */
    nav > .nav-backdrop {
      pointer-events: none;
    }

    .team-name {
      flex: 0 0 auto;
    }

    .hamburger {
      display: flex !important;
      position: fixed !important;
      /* CHANGE THESE TWO VALUES TO ADJUST POSITION */
      top: 1rem !important;        /* ← Adjust this for up/down position */
      right: 1rem !important;      /* ← Adjust this for left/right position */
      left: auto !important;
      bottom: auto !important;
      margin: 0 !important;
      z-index: 1002 !important;
      flex-shrink: 0;
      /* Precise click area */
      width: 44px !important;
      height: 44px !important;
      pointer-events: auto !important;
      overflow: visible;
      /* Remove any inherited positioning */
      transform: none !important;
    }
    
    /* Ensure backdrop is below hamburger */
    .nav-backdrop {
      z-index: 998;
    }

    .divider {
      display: none;
    }

    /* Backdrop overlay for mobile menu */
    .nav-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background-color: rgba(0, 0, 0, 0.3);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      z-index: 998;
      /* Completely hide when not active */
      visibility: hidden;
      display: block;
    }

    .nav-backdrop.active {
      opacity: 1;
      pointer-events: all;
      visibility: visible;
    }

    .nav-links {
      position: fixed;
      top: 0;
      right: -100%;
      height: 100vh;
      width: 250px;
      background-color: rgba(30, 30, 30, 0.75);
      backdrop-filter: blur(15px);
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      padding-top: 5rem;
      gap: 2rem;
      transition: right 0.3s ease;
      z-index: 999;
      box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
      right: 0;
    }

    .nav-links a {
      font-size: 1.5rem;
    }

    /* Adjust mute button position on mobile */
    .mute-btn {
      bottom: 60px;
      right: 20px;
      width: 45px;
      height: 45px;
    }

    /* Adjust scroll indicator on mobile */
    .scroll-indicator {
      bottom: 15%;
    }
  }  