/* style.css */

/* --- Variables & Basic Reset --- */
:root {
    --primary-color: #007bff;
    /* A strong blue accent */
    --secondary-color: #e41b17;
    /* Optional: A racing red for specific highlights */
    --dark-grey: #22252a;
    --medium-grey: #4a4a4a;
    --light-grey: #f4f4f7;
    --border-color: #e1e1e1;
    --text-color: #333;
    --text-light: #f8f9fa;
    --body-bg: #ffffff;
    --card-bg: #ffffff;
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 15px rgba(0, 0, 0, 0.1);
    --font-primary: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    /* Optional: For headings */
}

/* Import Google Fonts (Add this to your HTML <head> or use @import) */
/* @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;700&family=Roboto:wght@400;700&display=swap'); */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
    font-size: 16px;
    /* Base font size */
}

/* --- Layout & Containers --- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

section:nth-of-type(even) {
    /* Optional: Alternate background for sections */
    /* background-color: var(--light-grey); */
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-secondary, var(--font-primary));
    /* Use Poppins if loaded, else Roboto */
    font-weight: 700;
    color: var(--dark-grey);
    margin-bottom: 0.75em;
    line-height: 1.3;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    /* Darker blue on hover */
    text-decoration: underline;
}

/* --- Header & Footer --- */
header {
    background-color: var(--dark-grey);
    color: var(--text-light);
    padding: 15px 0;
    box-shadow: var(--shadow-light);
}

header h1, header  h2 {
    color: var(--text-light);
    font-size: 1.8rem;
    margin-bottom: 0.2em;
}

header p {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0;
}

footer {
    background-color: var(--dark-grey);
    color: #aaa;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: #ccc;
}

footer a:hover {
    color: var(--text-light);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(34, 37, 42, 0.8), rgba(34, 37, 42, 0.8)), url('images/hero-background-min.png');
    /* Replace with a cool car background */
    background-size: cover;
    background-position: center center;
    color: var(--text-light);
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    color: var(--text-light);
    font-size: 3rem;
    margin-bottom: 0.5em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
}

.cta-button,
.site-cta {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover,
.site-cta:hover {
    background-color: #0056b3;
    /* Darker blue */
    color: var(--text-light);
    text-decoration: none;
    transform: translateY(-2px);
}

/* --- Comparison Section --- */
.comparison-section h2 {
    text-align: center;
    margin-bottom: 1.5em;
}

.site-card {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    /* Ensure border-radius clips image */
    transition: box-shadow 0.3s ease;
}

.site-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.site-image {
    flex: 0 0 180px;
    /* Fixed width for image container */
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-grey);
    /* Subtle background for logo */
}

.site-image img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    /* Control logo height */
    object-fit: contain;
}

.site-info {
    padding: 25px;
    flex-grow: 1;
}

.site-info h3 {
    margin-top: 0;
    color: var(--dark-grey);
}

.site-info h3 a {
    color: var(--dark-grey);
    text-decoration: none;
}

.site-info h3 a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.site-summary {
    color: var(--medium-grey);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.site-pros-cons {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.site-pros-cons li {
    margin-bottom: 0.4rem;
    color: var(--medium-grey);
}

.site-pros-cons strong {
    color: var(--text-color);
    margin-right: 5px;
}

.site-pros-cons li::before {
    /* Optional: Icons for pros/cons */
    /* content: '✓ '; color: green; */
    /* content: '✗ '; color: red; */
}

.site-details {
    font-size: 0.9rem;
    color: var(--medium-grey);
    margin-bottom: 1.5rem;
}

.site-details span {
    display: inline-block;
    /* Or block for stacking */
    margin-right: 15px;
    margin-bottom: 5px;
}

.site-details strong {
    color: var(--text-color);
}

.site-cta {
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* --- Guide Section --- */
.guide-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 1rem;
}

.guide-section li {
    margin-bottom: 0.75rem;
}

.guide-section strong {
    color: var(--dark-grey);
}

/* --- FAQ Section --- */
.faq-section details {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 15px 20px;
}

.faq-section summary {
    font-weight: bold;
    cursor: pointer;
    outline: none;
    list-style: none;
    /* Remove default marker */
    position: relative;
    padding-right: 25px;
    /* Space for custom marker */
    color: var(--dark-grey);
}

/* Custom marker */
.faq-section summary::after {
    content: '+';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-section details[open] summary::after {
    content: '−';
    /* Change marker when open */
    transform: translateY(-50%);
}

.faq-section details p {
    margin-top: 15px;
    margin-bottom: 0;
    padding-left: 10px;
    /* Indent answer slightly */
    color: var(--medium-grey);
}

/* --- Disclaimer Section --- */
.disclaimer-section {
    background-color: var(--light-grey);
    padding: 30px 0;
    font-size: 0.85rem;
    color: var(--medium-grey);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.disclaimer-section h2 {
    font-size: 1.2rem;
    color: var(--medium-grey);
}

/* --- Responsive Design --- */

/* Tablets and smaller desktops */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .hero h1 {
        font-size: 2.8rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 40px 0;
    }

    .site-card {
        flex-direction: column;
        /* Stack image and info */
    }

    .site-image {
        flex-basis: auto;
        /* Reset basis */
        width: 100%;
        /* Full width */
        max-height: 150px;
        /* Limit height */
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
        /* Separator */
    }

    .site-image img {
        max-height: 60px;
        /* Smaller logo */
    }

    .site-info {
        padding: 20px;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .cta-button,
    .site-cta {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .site-image {
        max-height: 120px;
    }

    .site-image img {
        max-height: 50px;
    }

    .faq-section summary {
        padding-right: 20px;
    }

    .faq-section summary::after {
        right: 0;
    }
}

/* --- Added Styles for Navigation --- */
header .main-nav {
    margin-top: 10px;
    text-align: center; /* Or adjust alignment as needed */
}

header .main-nav a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 15px;
    padding: 5px 0;
    font-weight: bold;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent; /* For hover effect */
}

header .main-nav a:hover,
header .main-nav a.active /* Add .active class with JS if needed */
{
    color: #fff; /* Brighter on hover/active */
    border-bottom-color: var(--primary-color); /* Accent color underline */
}

/* --- Added Styles for Live Competitions Table --- */
.live-competitions-section h1 {
    text-align: center;
    margin-bottom: 1.5em;
}

.table-container {
    overflow-x: auto; /* Enable horizontal scroll on smaller screens */
    margin-top: 20px;
    margin-bottom: 20px;
}

/* --- Base Table Styles (Desktop First) --- */
.competition-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    box-shadow: var(--shadow-light);
    background-color: #fff;
}

.competition-table thead th {
    background-color: var(--dark-grey);
    color: var(--text-light);
    text-align: left;
    padding: 12px 15px;
    font-weight: bold;
    white-space: nowrap; /* Prevent headers from wrapping */
}

.competition-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.competition-table tbody tr:nth-of-type(even) {
    background-color: var(--light-grey);
}

.competition-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary-color);
}

.competition-table tbody tr:hover {
    background-color: #e9ecef; /* Light hover effect */
}

.competition-table td {
    padding: 12px 15px;
    vertical-align: middle; /* Align content vertically */
}

.prize-thumb {
    max-width: 80px; /* Control thumbnail size */
    height: auto;
    display: block; /* Prevents potential extra space below image */
    border-radius: 4px;
}

.competition-table td:nth-child(5), /* Ticket Price */
.competition-table td:nth-child(7),  /* Sold % */
.competition-table td:nth-child(8) /* Percentage */
{
    white-space: nowrap; /* Prevent wrapping for price/percentage */
    text-align: right;
}
.competition-table th:nth-child(5), /* Ticket Price */
.competition-table th:nth-child(7),  /* Sold % */
.competition-table td:nth-child(8) /* Percentage */
{
    text-align: right;
}

.competition-table .site-cta-small {
    padding: 5px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Responsive Adjustments for Table */
@media (max-width: 768px) {
    .competition-table {
        font-size: 0.9rem;
    }
    .competition-table thead th,
    .competition-table tbody td {
        padding: 10px 8px; /* Reduce padding */
    }
    .prize-thumb {
        max-width: 60px;
    }
}

@media (max-width: 576px) {
    .competition-table {
        font-size: 0.85rem;
    }
}

/* --- Hide Mobile Specific Cells by Default --- */
.mobile-only-cell {
    display: none;
}

/* --- Responsive Table Styles for Mobile (2-Column Stacked Card - CSS Grid) --- */
@media (max-width: 600px) {
    .table-container { overflow-x: visible; }
    .competition-table thead { display: none; } /* Hide headers */
    .competition-table tbody { display: block; }

    /* Hide Desktop Specific Cells on Mobile */
    .competition-table .desktop-only-cell {
        display: none;
    }
    /* Show Mobile Specific Cells on Mobile */
    .competition-table .mobile-only-cell {
        display: flex; /* Use flex for alignment within cell */
        align-items: flex-start; /* Align content to top */
    }

    .competition-table tr {
        display: grid;
        grid-template-areas:
            "image prize"
            "website cash-alt"
            "ends link";
            /* "ends price-sold" */
            /* "link empty"; */
        grid-template-columns: 1fr 2fr;
        gap: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        margin-bottom: 20px;
        padding: 10px;
        background-color: var(--card-bg);
        width: 100%;
        grid-auto-flow: row;
    }

    .competition-table tbody tr:nth-of-type(even) { background-color: var(--card-bg); }
    .competition-table tbody tr { border-bottom: none; }
    .competition-table tbody tr:last-of-type { border-bottom: none; }

    .competition-table td {
        padding: 2px 0;
        border-bottom: none;
        position: static;
        text-align: left;
        min-height: auto;
        background: none;
    }
    .competition-table td::before { display: none; }

    /* --- Assign grid areas --- */
    .competition-table td[data-label="Image"] {
        grid-area: image;
        justify-content: center;
        padding: 5px;
    }
    .prize-thumb { max-width: 90px; }

    .competition-table td[data-label="Website"] {
        grid-area: website;
        font-size: 0.8rem;
        color: var(--medium-grey);
        font-weight: bold;
    }

    .competition-table td[data-label="Ends"] {
        grid-area: ends;
        font-size: 0.9rem;
        color: var(--medium-grey);
    }
    .competition-table td[data-label="Ends"]::before {
        content: "Ends: ";
        font-weight: bold;
        color: var(--text-color);
    }

    .competition-table td[data-label="Link"] {
        grid-area: link;
        justify-content: flex-start;
    }
    .site-cta-small { padding: 6px 12px; font-size: 0.9rem; }
    .competition-table td[data-label="Link"] a {
        width: 100%;
        text-align: center;
    }

    .competition-table td[data-label="Prize"] {
        grid-area: prize;
        font-weight: bold;
        font-size: 0.95rem;
        line-height: 1.3;
        flex-direction: column;
        justify-content: space-between;
    }

    .competition-table td[data-label="Prize"] .normal-font {
        font-weight: normal;
    }

    .competition-table td[data-label="Cash-Alt"] {
        grid-area: cash-alt;
        font-style: italic;
        font-size: 0.85rem;
        color: var(--medium-grey);
        flex-direction: column;
        align-items: end;
    }

    .competition-table td[data-label="Price-Sold"] {
        grid-area: price-sold;
        font-size: 0.9rem;
        color: var(--text-color);
    }
    .competition-table td[data-label="Price-Sold"]::before {
        content: "Price ";
        font-weight: bold;
        color: var(--primary-color);
    }

    .competition-table td[data-label="Empty"] {
        grid-area: empty;
        display: none; /* Hide the empty cell */
    }
}