/* Modern Racing Results Website - 2025 */
:root {
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    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: var(--text-dark);
    background: var(--bg-light);
}

/* Header & Navigation */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

@media (min-width: 769px) {
    .site-header {
        position: sticky;
        top: 0;
    }
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-section {
    flex-shrink: 0;
}

.logo-section a {
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.logo-text {
    line-height: 1.3;
}

.logo-text .jit {
    color: var(--text-dark);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.logo-text .racing {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}

.logo-section img {
    display: none;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
    text-transform: capitalize;
    letter-spacing: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    text-align: center;
    line-height: 1.3;
}

.nav-link:hover {
    color: var(--primary-blue);
    transform: none;
    box-shadow: none;
    background: transparent;
}

.nav-link.active {
    color: var(--primary-blue);
    background: transparent;
}


/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--warning);
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.alert-banner strong {
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Secondary Navigation */
.secondary-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.secondary-link {
    padding: 0.625rem 1rem;
    background: var(--bg-light);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.secondary-link:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Main Content Layout */
.main-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

@media (max-width: 968px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.sidebar-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: var(--primary-blue);
    color: white;
    border-left-color: var(--primary-hover);
    transform: translateX(4px);
}

.sidebar-menu a.highlight {
    background: var(--warning);
    color: white;
    font-weight: 600;
}

.sidebar-menu a.highlight:hover {
    background: #d97706;
}

/* Main Content */
.main-content {
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.content-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.content-header h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.content-header .subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.content-section p, .content-section ul {
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-section ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.content-section strong {
    color: var(--text-dark);
    font-weight: 600;
}

.highlight-text {
    color: var(--primary-blue);
    font-weight: 600;
}

.warning-text {
    color: #dc2626;
    font-weight: 600;
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary-blue);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.warning-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

/* Sponsor Section */
.sponsor-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.sponsor-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.sponsor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sponsor-card img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Footer */
.site-footer {
    max-width: 1280px;
    margin: 3rem auto 2rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

.contact-email {
    font-size: 1.125rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.contact-email:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-bottom: 2rem;
    }




        width: 100%;
        flex-direction: column;
        gap: 0.375rem;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .secondary-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
    }

    .secondary-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .main-container {
        padding: 0 0.75rem;
        margin: 1rem auto;
        gap: 1rem;
    }

    .sidebar {
        gap: 1rem;
    }

    .sidebar-card {
        padding: 1rem;
    }

    .sidebar-card h3 {
        font-size: 1rem;
    }

    .sidebar-menu a {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .main-content {
        padding: 1rem;
    }

    .content-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .content-header h1 {
        font-size: 1.375rem;
    }

    .content-header .subtitle {
        font-size: 0.9rem;
    }

    .content-section h2 {
        font-size: 1.25rem;
    }

    .info-box, .warning-box {
        padding: 0.875rem 1rem;
    }

    .site-footer {
        padding: 1.5rem 1rem;
        font-size: 0.875rem;
    }

    /* Make tables responsive */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Trusted By Section - Horizontal Scrolling Rows */
.trusted-by-section {
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    padding: 3rem 0;
    margin-top: 2rem;
    overflow: hidden;
    position: relative;
}

.trusted-by-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.trusted-by-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.trusted-by-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-weight: 600;
    text-align: center;
    padding: 0 2rem;
}

.logos-slider {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.logo-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    width: max-content;
    flex-wrap: nowrap;
}

/* Scroll right animation */
.logo-row-right {
    animation: scrollRight 40s linear infinite;
}

/* Scroll left animation */
.logo-row-left {
    animation: scrollLeft 40s linear infinite;
}

/* Pause animation on hover */
.logo-row:hover {
    animation-play-state: paused;
}

@keyframes scrollRight {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(33.33%);
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

.logo-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100px;
    width: 220px;
    flex-shrink: 0;
}

.logo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.logo-item:hover::before {
    left: 100%;
}

.logo-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue);
    z-index: 10;
}

.logo-item img {
    height: 50px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: none;
    opacity: 1;
    transition: all 0.3s ease;
}

/* Make specific logos black */
.logo-item img[src*="suffolk-times"],
.logo-item img[src*="riverhead-news"] {
    filter: brightness(0) saturate(100%);
}

/* Make AJC and MileSplit logos taller to fill the space */
.logo-item img[src*="ajc-logo"],
.logo-item img[src*="milesplit"] {
    height: 80px;
    max-width: 200px;
}

.logo-item:hover img {
    transform: scale(1.1);
}

/* Keep black logos black on hover */
.logo-item:hover img[src*="suffolk-times"],
.logo-item:hover img[src*="riverhead-news"] {
    filter: brightness(0) saturate(100%);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .trusted-by-section {
        padding: 2.5rem 0;
    }

    .logos-slider {
        gap: 1.5rem;
    }

    .logo-row {
        gap: 1.5rem;
    }

    .logo-item {
        padding: 1rem 1.5rem;
        min-height: 80px;
        min-width: 160px;
    }

    .logo-item img {
        height: 40px;
        max-width: 120px;
    }

    .trusted-by-section h3 {
        margin-bottom: 2rem;
        font-size: 0.8125rem;
    }
}

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

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Mobile fixes for carousel */
@media (max-width: 768px) {
    .logo-row {
        will-change: transform;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .logo-row-right,
    .logo-row-left {
        animation-duration: 30s;
    }
    
    .logos-slider {
        -webkit-overflow-scrolling: touch;
    }
}

/* Ensure all rows are visible on load */
.logo-row-right,
.logo-row-left {
    transform: translateX(0);
}

/* Mobile specific positioning */
@media (max-width: 768px) {
    .logo-row-right {
        animation: scrollRightMobile 25s linear infinite;
    }
    
    .logo-row-left {
        animation: scrollLeftMobile 25s linear infinite;
    }
    
    @keyframes scrollRightMobile {
        0% {
            transform: translateX(0%);
        }
        100% {
            transform: translateX(33.33%);
        }
    }
    
    @keyframes scrollLeftMobile {
        0% {
            transform: translateX(0%);
        }
        100% {
            transform: translateX(-33.33%);
        }
    }
}

/* Better mobile header layout - grid instead of vertical stack */
@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .logo-section {
        width: 100%;
        text-align: center;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .jit {
        font-size: 1.125rem;
    }

    .racing {
        font-size: 0.75rem;
    }

    .main-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        flex-direction: unset;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.625rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 6px;
        background: var(--bg-light);
        border: 1px solid var(--border);
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--primary-blue);
        color: white;
        border-color: var(--primary-blue);
    }
}

/* Even smaller screens - make it more compact */
@media (max-width: 480px) {
    .main-nav {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.375rem;
    }

    .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.65rem;
    }
}

/* Better mobile header layout - grid instead of vertical stack - OVERRIDE */
@media (max-width: 768px) {
    .main-nav {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        flex-direction: unset !important;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.625rem 0.5rem !important;
        font-size: 0.75rem !important;
        border-radius: 6px;
        background: var(--bg-light);
        border: 1px solid var(--border);
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--primary-blue);
        color: white;
        border-color: var(--primary-blue);
    }
}

/* Even smaller screens - 3 columns for very compact layout */
@media (max-width: 480px) {
    .main-nav {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.375rem !important;
    }

    .nav-link {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.65rem !important;
    }
}

/* Fix carousel starting positions and infinite loop */
.logo-row-right {
    transform: translateX(-33.33%);
    animation: scrollRight 40s linear infinite;
}

.logo-row-left {
    transform: translateX(-33.33%);
    animation: scrollLeft 40s linear infinite;
}

@keyframes scrollRight {
    from {
        transform: translateX(-33.33%);
    }
    to {
        transform: translateX(0%);
    }
}

@keyframes scrollLeft {
    from {
        transform: translateX(-33.33%);
    }
    to {
        transform: translateX(-66.66%);
    }
}

/* Mobile animations with correct starting positions */
@media (max-width: 768px) {
    .logo-row-right {
        transform: translateX(-33.33%);
        animation: scrollRightMobile 30s linear infinite;
    }
    
    .logo-row-left {
        transform: translateX(-33.33%);
        animation: scrollLeftMobile 30s linear infinite;
    }
    
    @keyframes scrollRightMobile {
        from {
            transform: translateX(-33.33%);
        }
        to {
            transform: translateX(0%);
        }
    }
    
    @keyframes scrollLeftMobile {
        from {
            transform: translateX(-33.33%);
        }
        to {
            transform: translateX(-66.66%);
        }
    }
}
