/* #region General Gtyles */
body {
    margin: 0;
    padding: 0;
    /* Set padding-top to ONLY account for navbar height */
    padding-top: 54px; /* Adjust this to match your navbar height */
    background: linear-gradient(to bottom, #ffffff, #f8faf8);
    font-family: Arial;
    overflow: scroll;
}

table {
    table-layout: 100%;
    border-collapse: collapse;
    width: 100%;
}

.container {
    padding-left: 5px;
    padding-right: 5px;
}

.hidden {
    display: none !important;
}

.title-container {
    margin-top: 10px; /* Adjust based on your navbar height */
    padding-top: 10px;
    margin-left: 0px; /* Match Bootstrap's container padding */
    text-align: left;
    padding-bottom: 25px;
}

/* #region Loading Spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #184b27; /* Green color to match your theme */
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-text {
    /* Static text that doesn't spin */
    font-size: 14px;
    color: #333;
    margin-top: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* #endregion Loading Spinner */


thead, th {
    color: black !important;
    position: sticky;
    top: 60px; /* This should match your nav height */
    background-color: white;
    z-index: 1;
}

thead tr:first-child th {
    background-color: white;
    color: black;  /* or whatever color you want */
    font-weight: bold;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

thead tr th {
    background-color: white;
    position: sticky;
    top: 20px;  /* adjust based on your nav height */
}

.date-input {
    width: 150px; /* Adjust this value as needed */
}

h1, h2, h3, legend {
    padding-left: 0;
    margin-left: 0;
}

h1 {
    font-size: 1.75em; /* Adjust as needed */
}
h2 {
    font-size: 1.5rem; 
}
h3 {
    font-size: 1.25rem; /* Adjust as needed */
}
h4 {
    font-size: 1.0rem; /* Adjust as needed */
}
h5 {
    font-size: 0.75rem; /* Adjust as needed */
}
h6 {
    font-size: 0.5rem; /* Adjust as needed */
}

.d-flex {
    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */
}

.align-items-start {
    -webkit-box-align: start; /* OLD - iOS 6-, Safari 3.1-6 */
    -moz-box-align: start;    /* OLD - Firefox 19- */
    -ms-flex-align: start;    /* TWEENER - IE 10 */
    -webkit-align-items: flex-start; /* NEW - Chrome */
    align-items: flex-start;       /* NEW, Spec - Opera 12.1, Firefox 20+ */
}

.ml-2 {
    margin-left: 0.5rem;
}
/* #endregion */

/* #region Enter Scores Styles */
.enterscores .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    margin-left: 15px;  /* Add margin to the left */
}

.enterscores .form-group {
    flex: 1;
    max-width: 200px;  /* Limit the width of each form group */
}

.enterscores .form-group label {
    display: block;
    margin-bottom: 5px;
}

.enterscores .form-group input,
.enterscores .form-group select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    height: 38px;  /* Set explicit height for both inputs and selects */
    border: 1px solid #ced4da;  /* Consistent border */
    border-radius: 4px;  /* Rounded corners */
    appearance: none;  /* Removes default browser styling */
    -webkit-appearance: none;  /* For Safari */
    -moz-appearance: none;  /* For Firefox */
    background-color: white;
}

/* Add a custom arrow for the select element */
.enterscores .form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;  /* Make room for custom arrow */
}

#enterscores {
    table-layout: fixed;
    width: 80%;
    margin-left: 45px;  /* Adds space from left edge of screen */
}

#enterscores th, #enterscores td {
    padding: 2px; 
    text-align: left;
}

/* First column (Player) */
#enterscores th:nth-child(1), #enterscores td:nth-child(1) {
    width: 90px; /* Fixed width for Player column */
    text-align: left;
}

/* Second column (Brown Jacket Score) */
#enterscores th:nth-child(2), #enterscores td:nth-child(2) {
    width: 120px; /* Fixed width for BJ Score column */
    text-align: center;
}

/* Third column (Stableford Score) */
#enterscores th:nth-child(3), #enterscores td:nth-child(3) {
    width: 120px; /* Fixed width for Stableford Score column */
    text-align: center;
}

/* Center the input fields under the headings */
.bjpoints, .spoints {
    display: block;
    margin: 0 auto;
    text-align: center;
    width: 60px;
}
/* #endregion */

/* #region Navbar Styles */
.navbar {
    background-color: #333 !important; /* Your desired background color */
    color: white !important;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 54px;
}

/* Style navbar links */
.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important; /* Light white for normal links */
}

.navbar .navbar-nav .nav-link:hover {
    color: white !important;
}

/* Style for the brand/logo */
.navbar .navbar-brand {
    color: white !important;
}

/* Style for the hamburger icon - make it white */
.navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
/* Highlight the active page in the navigation */
.navbar-nav .nav-link.active {
    font-weight: bold;
    color: white !important;
    background-color: green !important;  /* Green background for active page */
    border-radius: 0.25rem;
}



/* Ensure hamburger is visible and working on mobile */
@media (max-width: 767px) {
    .navbar-toggler {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 1px solid rgba(255,255,255,.1) !important;
        padding: .25rem .75rem !important;
        font-size: 1.25rem !important;
        line-height: 1 !important;
        background-color: transparent !important;
        border-radius: .25rem !important;
        transition: box-shadow .15s ease-in-out !important;
        cursor: pointer !important;
    }
    
    .navbar-toggler-icon {
        display: inline-block !important;
        width: 1.5em !important;
        height: 1.5em !important;
        vertical-align: middle !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        background-size: 100% !important;
    }
    
    .navbar-collapse {
        position: absolute !important;
        top: 54px !important;
        left: 0 !important;
        width: 100% !important;
        background-color: green !important;
        z-index: 1000 !important;
    }
    
    .navbar-collapse.show {
        display: block !important;
    }
    
    .navbar-nav {
        padding: 10px !important;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0 !important;
    }
}
/* #endregion */

/* #region Availability Calendar Styles */
.availability-calendar {
position: relative;
overflow-x: auto;
padding-left: 25px; /* Add padding to the entire calendar */
}


.availability-calendar table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    border-spacing: 0;    }
/* Base cell styles */
.availability-calendar td {
    font-family: Arial, sans-serif;
    font-size: 8px;
    text-align: center;
    overflow: hidden;
    max-height: 80vh;
    position: relative;
    padding: 0;
    margin: 0;
    border: none;
    width: 15px;    /* Added to match header width */
    min-width: 15px;  /* Added to maintain consistency */
    max-width: 15px;  /* Add this to ensure consistency */
}
/* First column styles */
.availability-calendar td:first-child {
    min-width: 120px;
    width: 120px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fefefe;
    font-size: .7rem;
    text-align: left;
    padding: 8px;
    padding-top: 1px;
    padding-right: 8px !important;
    padding-left: 25px; /* Add more padding to align with the month name */
}
/* Header row styles */
/* This styles the row itself */
.availability-calendar tr:first-child {
    position: sticky;
    height: 35px;
}
/* This styles each cell within that row */
.availability-calendar tr:first-child td {
    position: relative;
    top: 0;
    z-index: 20;
    font-size: .8em !important;
    font-weight: 200;
    background-color: #fefefe !important;
    transform: rotate(-90deg) translateX(50%) !important;
    transform-origin: right bottom !important;
    text-align: left;
    vertical-align: middle !important;
    white-space: nowrap;
    border-spacing: 0;
    margin: 0;
    padding: 0 !important;
    overflow: visible;   
    min-height: 20px;
}
/* Special handling for first cell (corner cell) */
.availability-calendar tr:first-child td:first-child {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    vertical-align: middle;
    text-align: left;
    height: auto;
    padding: 2px;
    padding-left: 80px !important;
    z-index: 3;
    position: relative; /* Add this to help with positioning */
}

.availability-calendar td:nth-child(odd) {
    background-color: #f1f7f3;
}

.availability-calendar td:nth-child(even) {
    background-color: white;
}

.availability-calendar tr:hover td {
    background-color: #f0f8f4;
}
.availability-header-spacer {
    height: 35px; /* Adjust this value as needed */
}

/* Safari-specific fix for rotated headers */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .availability-calendar tr:first-child td {
        transform: rotate(-90deg);
        transform-origin: left top;
        position: relative;
    }
}

/* Add media query for narrow screens */
@media screen and (max-width: 900px) {
    .availability-calendar tr:first-child td {
        font-size: 0.7em;
    }
}

/* For screens under 600px */
@media screen and (max-width: 600px) {
    .availability-calendar tr:first-child td {
        font-size: .5em;
    }
}



.availability-calendar .monthLabel h3 {
    margin: 0;
    padding: 4px 8px;  /* Reduced padding */
    font-size: .9rem;  /* Smaller font size */
    color: black;
    font-weight: normal;  /* Less bold */
    flex-grow: 1;    /* Add this to allow text to take available space */
}

.availability-calendar .monthLabel td {
    padding: 2px 8px;  /* Reduced cell padding */
    padding-right: 160px;
    background-color: #fefefe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add twisty indicator for expandable months */
.availability-calendar .monthLabel td:first-child {
    position: relative;
    padding-right: 20px;  /* Make room for the twisty */
    width: 120px;        /* Match the width of first column */
    max-width: 120px;    /* Ensure it doesn't expand */
    background-color: #fefefe;
    display: flex;       /* Add this */
    justify-content: space-between; /* Add this */
    align-items: center; /* Add this */
}

.availability-calendar .monthLabel td:first-child::before {
    content: '▼';  /* Down-pointing triangle */
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #333;
}

/* Style for collapsed state */
.availability-calendar .monthLabel.collapsed td:first-child::before {
    content: '▶';  /* Right-pointing triangle */
}

.d-flex {
    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */
}

.align-items-center {
    -webkit-box-align: center; /* OLD - iOS 6-, Safari 3.1-6 */
    -moz-box-align: center;    /* OLD - Firefox 19- */
    -ms-flex-align: center;    /* TWEENER - IE 10 */
    -webkit-align-items: center; /* NEW - Chrome */
    align-items: center;       /* NEW, Spec - Opera 12.1, Firefox 20+ */
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.player-list {
    margin-top: 20px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.player-item:hover {
    background-color: #f5f5f5;
}

.player-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    cursor: pointer;
}

.edit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
}

.delete-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
}

.save-button {
    margin: 5px;
    padding: 4px 8px;
    background-color: #184b27;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 200px;  /* Set a fixed width */
    height: 40px;  /* Set a fixed height */
    min-width: 200px; /* Ensure minimum width */
    white-space: nowrap; /* Prevent text from wrapping */
    overflow: hidden; /* Hide any overflow text */
    text-overflow: ellipsis; /* Add ellipsis for overflow text */
    display: inline-block; /* Ensures consistent box model */
    text-align: center; /* Center the text */
    line-height: 32px; /* Vertically center the text */
    font-size: 14px; /* Consistent font size */
}

.save-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.save-button:hover:not(:disabled) {
    background-color: #1e5d32;
}

/* Status button styles */
.availability-calendar button.status-- {
    background-color: #f0f0f0;
}

.availability-calendar button.status-Y {
    background-color: #90EE90;
}

.availability-calendar button.status-N {
    background-color: #FFB6C1;
}

.availability-calendar button.status-M {
    background-color: #FFE4B5;
}
/* #endregion */

/* #region Standings Styles */
.standings-table, .standingsbj {
    width: 100%;
    max-width: 400px;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;  /* Base font size for tables */
}

.standings-table *, .standingsbj * {
    position: static;
}

.standings-table thead, .standingsbj thead {
    position: static;
}

.standings-table th,
.standings-table td,
.standingsbj th,
.standingsbj td {
    padding: 6px;  /* Slightly reduced padding to match smaller font */
    border: 1px solid #ddd;
    position: static;
    font-size: 0.9em;  /* Even smaller font size for cell content */
}

.standings-table th,
.standingsbj th {
    background-color: white;
    position: static;
    top: auto;
    z-index: auto;
}

.standings-table tbody tr,
.standingsbj tbody tr {
    position: static;
}

.standings-table tbody td,
.standingsbj tbody td {
    position: static;
}

/* Column widths */
.standings-table td:first-child,
.standings-table th:first-child,
.standingsbj td:first-child,
.standingsbj th:first-child {
    width: 70%;
}

.standings-table td:nth-child(2),
.standings-table th:nth-child(2),
.standingsbj td:nth-child(2),
.standingsbj th:nth-child(2) {
    width: 30%;
    text-align: center;
}

/* Alternating row colors */
.standings-table tbody tr:nth-child(even),
.standingsbj tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.standings-table tbody tr:nth-child(odd),
.standingsbj tbody tr:nth-child(odd) {
    background-color: #ffffff;
}
/* #endregion */

/* #region Gamelog Styles */
.gamelog-table {
    width: 100%;
    max-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 5px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
}

/* Make the table container horizontally scrollable */
.gamelog-table-container {
    width: 100%;
    overflow-x: auto;
    position: relative;
}

/* Make the date column sticky */
.gamelog-table .gamedate {
    text-align: left;
    width: 100px;
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: white;
    border-right: 2px solid #ddd;
}

.gamelog-table th,
.gamelog-table td {
    padding: 6px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 0.9em;
    position: static;  
    z-index: 1;
}

/* Ensure proper background for zebra striping with sticky column */
.gamelog-table .gamelog:nth-child(even) .gamedate {
    background-color: #f2f2f2;
}

.gamelog-table .gamelog:nth-child(odd) .gamedate {
    background-color: #ffffff;
}

/* Ensure month headers have proper background when sticky */
.gamelog-table .month-header .gamedate {
    background-color: #e6e6e6;
}

.gamelog-table .month-header:hover .gamedate {
    background-color: #d9d9d9;
}

/* Month grouping specific styles */
.gamelog-table .month-header {
    background-color: #e6e6e6;
    cursor: pointer;
}

.gamelog-table .month-header:hover {
    background-color: #d9d9d9;
}

.gamelog-table .month-rows {
    display: table-row;
}

.gamelog-table .month-rows.collapsed {
    display: none;
}

.gamelog-table .month-header td:first-child::before {
    content: '▼';
    margin-right: 8px;
}

.gamelog-table .month-header.collapsed td:first-child::before {
    content: '▶';
}


.gamelog-table th:nth-child(n+2) {
    border-right: 1px solid #000;
}

/* Holes column specific */
.gamelog-table .holes {
    width: 60px;
}

.gamelog-table .gamelog td:nth-child(2n+2) {
    border-right: 1px solid #000;
}

/* Alternating row colors */
.gamelog-table .gamelog:nth-child(even) {
    background-color: #f2f2f2;
}

.gamelog-table .gamelog:nth-child(odd) {
    background-color: #ffffff;
}

/* Player score columns */
.gamelog-table .player-scores {
    width: 80px;
}

#gameDays {
    min-height: 150px;
    width: 200px;
    border-right: 1px solid #000;
}
/* #endregion */

/* #region Gallery Styles */
.year-section {
    margin-bottom: 40px;
    padding-top: 20px;
}

.year-heading {
    background-color: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-left: 4px solid #0d6efd;
    font-weight: 600;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.gallery-item {
    width: 280px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

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

.gallery-item .desc {
    padding: 10px;
    text-align: center;
    background-color: #fff;
    font-size: 14px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0d6efd;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
}
/* #endregion */

/* #region Admin Bookings Styles */
.admin-bookings .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;  /* Space between label and input */
}

.admin-bookings label {
    min-width: 100px;  /* Fixed width for labels */
    text-align: right;  /* Right-align the month names */
    margin-bottom: 0;  /* Remove default bottom margin */
}

.admin-bookings input[type="text"] {
    width: 200px;  /* Fixed width for all input boxes */
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.admin-bookings .card {
    max-width: 500px;  /* Limit overall form width */
    margin: 0 auto;    /* Center the form */
    padding: 20px;
}

.admin-bookings .card-body {
    padding: 20px;
}

.admin-bookings h4 {
    margin-bottom: 20px;
    text-align: center;
}
/* #endregion */
