/* 
  Theme Colours 
  Primary Green: #1e4d2b
  Secondary Green (Hover/Accent): #2a6639
  Accent Lime: #a4c639
  Dark Text: #1a1a1a
  Light Grey: #f4f4f4
*/

:root {
    --color-primary: #1e4d2b;
    --color-primary-dark: #153820;
    --color-secondary: #2a6639;
    --color-accent: #a4c639;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-background: #ffffff;
    --color-background-light: #f9fbf9;
    --color-white: #ffffff;

    --font-main: 'Outfit', sans-serif;

    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-background);
    padding-top: 100px;
    /* Account for fixed header */
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-white {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.btn-white:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Header & Nav */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    max-width: 100%;
    /* Override default container max-width */
    padding: 0 40px;
    /* Add slightly more padding for the "edge" look */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.logo img {
    height: 80px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text);
}

.nav-link:hover {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    /* Enforce 16:9 Aspect Ratio based on viewport width */
    min-height: 56.25vw;
    display: flex;
    align-items: center;

    /* Linear gradient overlay for text readability */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('images/golfhole.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: left;
}

.hero-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding-left: 20%;
    /* 20% left margin */
    padding-right: 5%;
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    color: var(--color-white);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
    font-size: 2rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--color-white);
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-start;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.bg-light {
    background-color: var(--color-background-light);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--color-white);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: var(--color-secondary);
    margin-bottom: 12px;
    font-size: 1.25rem;
}

/* Split Layout */
.split-layout {
    display: flex;
    align-items: center;
    gap: 60px;
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

.text-block {
    flex: 1;
}

.text-block h2 {
    font-size: 2.25rem;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.visual-block {
    flex: 1;
    min-height: 400px;
    background-color: var(--color-background-light);
    /* Placeholder */
    border-radius: 24px;
    background-size: cover;
    background-position: center;
}

.society-visual {
    background-image: url('images/society.png');
    background-size: cover;
    background-position: center;
}

.swindle-visual {
    background-image: url('images/swindle.png');
    background-size: cover;
    background-position: center;
}


/* CTA Section */
.cta-section {
    padding: 100px 0;
    background-color: var(--color-primary);
    color: var(--color-white);
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--color-white);
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--color-text-light);
    border-top: 1px solid #eaeaea;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--color-white);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease;
        z-index: 1000;
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    /* Animate Hamburger */
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

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

    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    .hero-container,
    .split-layout,
    .split-layout.reverse {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        padding-top: 100px;
    }

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

    .hero-actions {
        justify-content: center;
    }

    .visual-block {
        width: 100%;
        min-height: 250px;
    }
}

.form-grid {
    display: grid;
    grid-template-columns: max-content 1fr max-content 1fr;
    gap: 12px 20px;
    align-items: center;
}

.form-grid input[type="hidden"] {
    display: none;
}

.form-grid .form-group {
    display: contents;
    /* Labels and inputs become direct grid items */
}

.form-grid label {
    text-align: right;
    font-weight: 500;
}

.form-grid input[type="text"],
.form-grid select,
.form-grid textarea {
    width: 100%;
}

.form-grid input[type="date"],
.form-grid input[type="time"],
.form-grid input[type="number"] {
    width: auto;
    min-width: 100px;
    justify-self: start;
}

/* Specific overrides */
#comp-description {
    grid-column: 2 / 5;
    /* Spans from 2nd column to the end */
}

/* Button Container */
.form-actions {
    grid-column: 1 / -1;
    /* Spans full width */
    display: flex;
    /* Flexbox for side-by-side buttons */
    gap: 16px;
    justify-content: flex-start;
    /* Left aligned */
    margin-top: 16px;
}

.hidden {
    display: none !important;
}

.v-hidden {
    visibility: hidden !important;
}

.grid-left {
    justify-self: start !important;
}

.control-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.form-hint {
    display: none;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 4px;
    line-height: 1.2;
}

.control-wrapper:focus-within .form-hint {
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--color-white);
    box-shadow: var(--shadow-soft);
    border-radius: 8px;
    overflow: hidden;
    /* For border radius */
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.data-table tr:hover {
    background-color: var(--color-background-light);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.shotgun-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-config-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-config-wrapper select {
    width: auto !important;
}

.flex-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: #fefefe;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Select Player Modal specific */
#player-select-modal .modal-content {
    max-width: 500px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--color-text);
}

/* Tee Sheet Table */
.tee-sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    table-layout: fixed;
    /* Fix layout shift */
}

.tee-sheet-table th,
.tee-sheet-table td {
    border: 1px solid #e0e0e0;
    padding: 10px;
    text-align: center;
}

.tee-sheet-table th {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.slot-cell {
    cursor: pointer;
    transition: background-color 0.2s;
}

.slot-cell:hover:not(.filled) {
    background-color: #f0f8f0;
}

.slot-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.slot-empty {
    color: #ccc;
    font-style: italic;
}

.btn-remove-slot {
    background: none;
    border: none;
    color: #cc0000;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
}

.btn-remove-slot:hover {
    color: #ff0000;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: color 0.2s, transform 0.2s;
}

.btn-icon:hover {
    color: var(--color-secondary);
    transform: scale(1.1);
}

.btn-icon:disabled {
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.format-settings-btn {
    margin-left: 8px;
}

.attribute-row {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attribute-row label {
    font-weight: 500;
    font-size: 0.9rem;
}

.attribute-row input,
.attribute-row select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Player List in Modal */
#player-list {
    margin-top: 16px;
    border: 1px solid #eee;
    max-height: 300px;
    overflow-y: auto;
}

#player-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

#player-list li:hover {
    background-color: #f9f9f9;
}

#player-search {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* === Split Tee Sheet Modal === */

.full-screen-modal .modal-content.split-modal-content {
    width: 95%;
    max-width: 95%;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.split-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
}

.split-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.split-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Contains scroll areas */
}

/* Left Sidebar */
.player-sidebar {
    width: 300px;
    min-width: 300px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.player-list-header {
    display: flex;
    justify-content: space-between;
    padding: 5px 15px;
    background: #eee;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    user-select: none;
}

.player-list-header .sortable {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-list-header .sortable:hover {
    color: var(--color-primary);
}

.sort-inactive {
    opacity: 0.3;
}

.slot-hcap {
    font-size: 0.75em;
    color: #666;
    font-weight: normal;
}

.sidebar-header {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.player-list-header {
    display: flex;
    justify-content: space-between;
    padding: 5px 15px;
    background: #eee;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
}

.draggable-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    list-style: none;
}

.draggable-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: grab;
    transition: background 0.2s;
    background: #fff;
}

.draggable-item:hover {
    background: #f0f8f0;
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item .p-hcap {
    font-weight: 600;
    color: var(--color-secondary);
    width: 30px;
    text-align: right;
}

/* Main Content */
.teesheet-main {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: #fff;
}

/* Form Controls */
.form-control-sm {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Drag & Drop Feedback */
.slot-cell.empty {
    transition: all 0.2s;
}

.slot-cell.empty:hover {
    background: #f9f9f9;
}

/* When valid drop target */
.slot-cell.drag-over {
    background: #e0ffe0 !important;
    border: 2px dashed var(--color-secondary);
}
/* Tee Sheet Enhancements */
.reserved-row td {
    background-color: #f0f0f0 !important;
    color: #888;
}

.reserved-row td strong {
    color: #666;
}

/* Allow interaction on cells, but row looks disabled */
.reserved-row .slot-cell.empty {
    background-color: #e8e8e8;
}

/* Multi-select in Player List */
.player-list-item {
    user-select: none; /* Prevent text selection during shift-click */
}

.player-list-item.selected {
    background-color: #e6f4ea !important; /* Light green */
    border-left: 4px solid var(--color-primary);
}
