* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #003d82 0%, #0051a5 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    height: 80px;
    width: auto;
    border-radius: 10px;
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-text .tagline {
    font-size: 0.9em;
    opacity: 0.95;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

/* Mobile Menu Toggle Button - Hamburger Icon */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 45px;
    height: 45px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-toggle span {
    width: 32px;
    height: 4px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
    pointer-events: none;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(9px, 9px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(9px, -9px);
}

/* Mobile Backdrop */
.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-backdrop.active {
    display: block;
    opacity: 1;
}

/* Main Content */
main {
    background-color: white;
    min-height: 60vh;
}

section {
    padding: 40px 0;
}

section:nth-child(even) {
    background-color: #f9f9f9;
}

h2 {
    color: #003d82;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #FFD700;
    padding-bottom: 10px;
}

h3 {
    color: #003d82;
    margin-bottom: 15px;
    margin-top: 25px;
    font-size: 1.3em;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(0, 61, 130, 0.85) 0%, rgba(0, 81, 165, 0.85) 100%), 
                url('images//referees/PremFinal25.jpeg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    padding: 60px 0;
    position: relative;
}

/* Desktop - adjust background to show referees faces */
@media (min-width: 769px) {
    .hero {
        background-position: center 20%;
    }
}

.hero h2 {
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 20px;
    border: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid #FFD700;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,61,130,0.2);
}

.card h3 {
    margin-top: 0;
    color: #003d82;
}

.card p {
    margin-bottom: 20px;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #003d82;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    border: 2px solid #003d82;
    font-weight: 500;
}

.btn:hover {
    background-color: #FFD700;
    color: #003d82;
    border-color: #FFD700;
}

.btn-secondary {
    background-color: #FFD700;
    color: #003d82;
    border-color: #FFD700;
}

.btn-secondary:hover {
    background-color: #003d82;
    color: #FFD700;
}

/* Info Boxes */
.info-box {
    background-color: #e8f4ff;
    border-left: 4px solid #003d82;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box h3 {
    margin-top: 0;
    color: #003d82;
}

.info-box.gold {
    background-color: #fff9e6;
    border-left-color: #FFD700;
}

/* Content Pages */
.content-section {
    max-width: 1000px;
    margin: 0 auto;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #003d82;
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

/* Contact Cards */
.contact-card {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #FFD700;
}

.contact-card h3 {
    color: #003d82;
    margin-top: 0;
    margin-bottom: 10px;
}

.contact-card p {
    margin: 5px 0;
}

.contact-card a {
    color: #003d82;
    text-decoration: none;
    font-weight: 500;
}

.contact-card a:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* Panel Cards */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.panel-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #003d82;
}

.panel-card h3 {
    margin-top: 0;
    color: #003d82;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 10px;
}

.panel-card ul {
    list-style: none;
    padding: 0;
}

.panel-card li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.panel-card li:last-child {
    border-bottom: none;
}

/* Standards Table */
.standards-table {
    margin: 30px 0;
}

.standards-table th {
    background-color: #FFD700;
    color: #003d82;
}

.level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.level-5 { background-color: #FFD700; color: #003d82; }
.level-4 { background-color: #003d82; color: white; }
.level-3 { background-color: #0051a5; color: white; }
.level-2 { background-color: #6699cc; color: white; }
.level-1 { background-color: #99bbdd; color: #003d82; }

/* Form Embed */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.form-container iframe {
    width: 100%;
    min-height: 800px;
    border: none;
}

/* Lists */
ul {
    margin: 15px 0;
    padding-left: 25px;
}

li {
    margin-bottom: 8px;
}

/* Links */
a {
    color: #003d82;
    transition: color 0.3s;
}

a:hover {
    color: #FFD700;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #003d82 0%, #0051a5 100%);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #FFD700;
}

footer a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
        order: 3;
        margin-left: 10px;
    }
    
    .logo-section {
        order: 1;
        flex: 1;
        max-width: calc(100% - 70px);
        min-width: 0;
    }
    
    nav {
        order: 2;
        display: none;
        position: fixed;
        top: 80px; /* Adjusted for smaller header */
        left: 0;
        right: 0;
        bottom: 0;
        max-height: calc(100vh - 80px);
        background: #003d82;
        z-index: 1000;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    nav.active {
        display: block;
        box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    
    nav ul {
        flex-direction: column;
        padding: 0 0 200px 0; /* Removed top padding - start menu immediately */
        gap: 0;
    }
    
    nav ul li:first-child {
        padding-top: 10px;
    }
    
    nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
    
    nav a {
        display: block;
        padding: 16px 25px;
        font-size: 1.05em;
        text-align: left;
        min-height: 50px;
    }
    
    .logo-section {
        flex-direction: row;
        gap: 10px;
    }
    
    .logo-section img {
        height: 50px;
        width: auto;
    }
    
    .logo-text {
        flex: 1;
        min-width: 0;
    }
    
    .logo-text h1 {
        font-size: 0.95rem;
        line-height: 1.1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .logo-text .tagline {
        font-size: 0.7rem;
        line-height: 1.1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero h2 {
        font-size: 1.8em;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .panel-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 8px;
    }
}

/* Desktop - Ensure mobile styles don't bleed through */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-backdrop {
        display: none !important;
    }
    
    nav {
        display: block !important;
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        background: transparent !important;
    }
    
    nav ul {
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
        gap: 12px !important;
    }
    
    nav ul li {
        width: auto !important;
        border-bottom: none !important;
    }
    
    nav ul li:first-child {
        padding-top: 0 !important;
    }
    
    nav a {
        padding: 8px 12px !important;
        font-size: 1em !important;
        min-height: auto !important;
    }
}

/* Smaller mobile screens */
@media (max-width: 480px) {
    .logo-section {
        gap: 8px;
    }
    
    .logo-section img {
        height: 45px;
        width: auto;
    }
    
    .logo-text h1 {
        font-size: 0.85rem;
    }
    
    .logo-text .tagline {
        font-size: 0.65rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .logo-section img {
        height: 40px;
        width: auto;
    }
    
    .logo-text h1 {
        font-size: 0.8rem;
    }
    
    .logo-text .tagline {
        font-size: 0.6rem;
    }
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #f0f0f0;
    aspect-ratio: 3/4;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,61,130,0.3);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,61,130,0.9), transparent);
    color: white;
    padding: 30px 10px 10px;
    font-size: 0.9em;
    text-align: center;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f4ff 0%, #f0f0f0 100%);
    color: #666;
    font-size: 0.9em;
    text-align: center;
    padding: 20px;
    border: 2px dashed #ccc;
}

/* Sponsor Section */
.sponsors-section {
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    padding: 40px 0;
    margin: 40px 0;
    border-top: 3px solid #FFD700;
    border-bottom: 3px solid #FFD700;
    overflow: hidden;
}

/* Sponsor Carousel */
.sponsors-carousel {
    position: relative;
    overflow: hidden;
    padding: 30px 0;
}

.sponsors-track {
    display: flex;
    gap: 40px;
    animation: scroll 30s linear infinite;
    width: fit-content;
}

.sponsors-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Sponsor logos in carousel */
.sponsor-item {
    flex-shrink: 0;
    width: 200px;
    height: 120px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.sponsor-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 5px 20px rgba(0,61,130,0.2);
}

.sponsor-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* Static Grid Option */
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 30px 0;
    align-items: center;
    justify-items: center;
}

.sponsor-logo {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    max-width: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

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

.sponsor-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,61,130,0.2);
}

.sponsor-placeholder {
    background: linear-gradient(135deg, #e8f4ff 0%, #f0f0f0 100%);
    border: 2px dashed #003d82;
    color: #666;
    font-size: 0.9em;
}

/* Mobile adjustments for sponsors */
@media (max-width: 768px) {
    .sponsors-track {
        animation-duration: 20s;
    }
    
    .sponsor-item {
        width: 160px;
        height: 100px;
    }
    
    .sponsor-item img {
        max-height: 60px;
    }
}

/* Service Awards Tables */
.service-table {
    background: white;
    margin: 20px 0;
}

.service-table th {
    background: linear-gradient(135deg, #003d82 0%, #0051a5 100%);
}

.service-years-badge {
    display: inline-block;
    background: #FFD700;
    color: #003d82;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.honour-card {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #FFD700;
}

.honour-card h4 {
    color: #003d82;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Photo Upload Instructions */
.upload-instructions {
    background: #fff9e6;
    border: 2px solid #FFD700;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.upload-instructions h4 {
    color: #003d82;
    margin-top: 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}