/* Charity Race Website Styles */

:root {
    --primary-color: #FFCA28; /* Lighter Amber */
    --secondary-color: #FFB74D; /* Lighter Dark Amber */
    --dark-color: #333333; /* Charcoal */
    --light-color: #F5F5F5; /* Off-white */
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('lough-background.jpg') no-repeat center center fixed;
    background-size: cover;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    overflow: hidden;
    background-color: rgba(255, 250, 240, 0.7); /* Very subtle amber tint with lower opacity */
    border-radius: 5px;
    border-left: 2px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber accent border */
}

/* Header */
.header {
    background-color: var(--dark-color);
    color: #fff;
    padding: 1rem 0;
}

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 2rem;
}

.navbar ul {
    display: flex;
}

.navbar a {
    color: #fff;
    padding: 0.45rem;
    margin: 0 0.25rem;
    @media (max-width: 385px) {
        padding: 0.35rem;
        margin: 0 0.15rem;
    }
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.navbar a:hover {
    color: rgba(255, 202, 40, 0.9); /* More transparent amber */
    border-bottom: 1px solid rgba(255, 202, 40, 0.7);
}

.navbar a.current {
    color: rgba(255, 202, 40, 0.9); /* More transparent amber */
    border-bottom: 1px solid rgba(255, 202, 40, 0.7);
    font-weight: bold;
}

/* Main section */
.main-section {
    color: #fff;
    position: relative;
}

/* Fix for mobile landscape mode */
@media (max-width: 900px) and (max-height: 450px) and (orientation: landscape) {
    .main-section {
        height: auto;
        min-height: 300px;
        padding-bottom: 1rem;
    }

    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .main-section h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .main-section p {
        font-size: 1rem;
        margin: 0.5rem 0;
    }

    .content {
        padding: 1rem !important;
    }
}

.main-section .overlay {
    background: linear-gradient(to bottom, rgba(51, 51, 51, 0.8), rgba(51, 51, 51, 0.6)); /* Charcoal gradient */
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-bottom: 2px solid rgba(255, 202, 40, 0.7); /* Thinner, more transparent amber accent border */
}

.main-section .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.main-section h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    display: inline-block;
}

.main-section h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background-color: rgba(255, 202, 40, 0.7); /* Thinner, more transparent amber underline */
}

.main-section p {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 2rem 0;
    color: rgba(255, 255, 255, 0.9);
}

.btn {
    display: inline-block;
    background: rgba(255, 202, 40, 0.85); /* More transparent amber */
    color: var(--dark-color); /* Charcoal text for better contrast */
    padding: 0.8rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    transition: all 0.2s ease-in;
    font-weight: bold;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--dark-color); /* Charcoal */
    color: #fff;
}

/* Section styling */
@media (min-width: 1100px) {
    .section {
        margin: 2rem 0;
    }
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--dark-color); /* Charcoal */
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber underline */
}

.section-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #555; /* Slightly darker text for better readability */
}

.card-section-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #555; /* Slightly darker text for better readability */
    font-style: italic;
    padding-top: 0.5rem;
}

/* Card styling */
.card {
    background-color: #FFFCF5; /* Even lighter amber, almost white */
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 1rem 0;
    border-top: 1px solid rgba(255, 202, 40, 0.5); /* Thinner, more transparent amber accent border */
}

.card h3 {
    color: var(--dark-color); /* Charcoal */
    border-left: 2px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber accent */
    padding-left: 10px;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
}

/* Table styling */
.table-container {
    overflow-x: auto;
}

.search-container {
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.year-dropdown {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-left: 2px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber left border */
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #FFFCF5; /* Even lighter amber, almost white */
    min-width: 100px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    color: var(--dark-color);
}

.records-dropdown {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-left: 2px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber left border */
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #FFFCF5; /* Even lighter amber, almost white */
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    color: var(--dark-color);
}

.year-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 202, 40, 0.1); /* More subtle amber glow */
}

.search-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-left: 2px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber left border */
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #FFFCF5; /* Even lighter amber, almost white */
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 202, 40, 0.1); /* More subtle amber glow */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    @media (max-width: 420px) {
        font-size: 0.9rem;
    }
    @media (max-width: 400px) {
        font-size: 0.85rem;
    }
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;

    @media (max-width: 640px) {
        padding: 0.5rem 0.2rem;
    }
    @media (max-width: 400px) {
        padding: 0.5rem 0.1rem;
    }
}

table th {
    background-color: var(--dark-color); /* Charcoal */
    color: #fff;
    border-bottom: 1px solid rgba(255, 202, 40, 0.6); /* Thinner, more transparent amber border */
}

table tr:nth-child(even) {
    background-color: rgba(255, 250, 240, 0.3); /* Even lighter amber with lower opacity */
}

table tr:hover {
    background-color: rgba(255, 202, 40, 0.1); /* Lighter amber with very low opacity */
}

/* Location and Course page styles */
.location-iframe, .course-iframe {
    display: block;
    min-height: 500px; /* Fallback height */
    height: 100%;
    border: 0;
}

/* Make the section and container take up the remaining vertical height on the location and course pages */
.location-section, .course-section {
    height: calc(100vh - 80px); /* Subtract approximate header height */
    margin: 0;
    padding: 0;
}

.location-section .container, .course-section .container {
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Responsive adjustments for the location page */
@media (max-width: 768px) {
    .location-section, .course-section {
        height: calc(100vh - 120px); /* Adjust for taller header on mobile */
    }
}

@media (max-width: 480px) {
    .location-section, .course-section {
        height: calc(100vh - 150px); /* Further adjust for very small screens */
    }
}


/* Modal Styles */
[x-cloak] {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #FFFCF5;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-top: 2px solid rgba(255, 202, 40, 0.6);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
    border-left: 2px solid rgba(255, 202, 40, 0.6);
    padding-left: 10px;
}

.close-btn {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 1rem;
}

.runner-detail {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.runner-detail:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: bold;
    color: var(--dark-color);
}

.detail-value {
    color: #555;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Hide table columns for small screens */
.results-table {
    @media (min-width: 870px) {
        table th:nth-child(1),
        table td:nth-child(1) {
            display: none;
        }
    }
    @media (max-width: 1000px) {
        table th:nth-child(7),
        table td:nth-child(7) {
            display: none;
        }
    }
    @media (max-width: 870px) {
        table th:nth-child(3),
        table th:nth-child(10),
        table td:nth-child(3),
        table td:nth-child(10) {
            display: none;
        }
    }
    @media (max-width: 600px) {
        table th:nth-child(5),
        table th:nth-child(8),
        table td:nth-child(5),
        table td:nth-child(8) {
            display: none;
        }
    }
}

.records-table {
    @media (min-width: 600px) {
        table th:nth-child(1),
        table td:nth-child(1) {
            display: none;
        }
    }

    @media (max-width: 600px) {
        table th:nth-child(7),
        table td:nth-child(7) {
            display: none;
        }
    }
    @media (max-width: 530px) {
        table th:nth-child(6),
        table td:nth-child(6) {
            display: none;
        }
    }
}

/* Chevron for touch devices */
.chevron-cell {
    width: 25px;
    text-align: right;
    padding-right: 10px;
}

.right-chevron {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Loading Spinner */
.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    text-align: center;
}

.loading-spinner-container p {
    margin-top: 1rem;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 202, 40, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Popup Notification */
.popup-notification {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark-color);
    color: #fff;
    padding: 1rem;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 2px solid rgba(255, 202, 40, 0.6);
}

.popup-notification.show {
    transform: translateY(0);
}

.popup-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    margin: 0 0.5rem;
}

.popup-notification p {
    margin: 0;
    padding: 0 1rem;
}

.popup-notification .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.popup-notification .right-chevron {
    padding-right: 0.725rem;
}

/* Responsive */
@media (max-width: 1000px) {
    /* Make table rows clickable on mobile */
    table tbody tr {
        cursor: pointer;
    }

    table tbody tr:hover {
        background-color: rgba(255, 202, 40, 0.2);
    }
}

@media (max-width: 480px) {

    /* Adjust modal for very small screens */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 0.8rem;
    }

    .runner-detail {
        margin-bottom: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem; /* Reduced container padding */
    }

    .navbar {
        flex-direction: column;
        text-align: center;
        padding: 0.7rem 1rem; /* Reduced navbar padding */
    }

    .navbar ul {
        margin-top: 1rem;
    }

    .main-section h1 {
        font-size: 2.5rem;
    }

    .main-section p {
        font-size: 1.2rem;
    }

    .card {
        padding: 1.5rem 1rem; /* Reduced card padding */
    }

    .year-dropdown, .search-input {
        padding: 0.6rem; /* Reduced input padding */
    }

    /* Reduce border widths */
    .container {
        border-left-width: 1px; /* Thinner left border */
    }

    .card {
        border-top-width: 1px; /* Thinner top border */
    }
}
