/**
 * Starter Sheet Standalone Styles
 * Optimized for both screen and print
 */

/* Header Styles */
.ttbp-starter-header {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ttbp-starter-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ttbp-starter-title h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #121212;
    font-weight: 600;
}

.ttbp-starter-date-display {
    margin: 0;
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.ttbp-starter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Date Navigation */
.ttbp-date-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ttbp-date-picker {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 140px;
    text-align: center;
    cursor: pointer;
    background: white;
}

.ttbp-date-picker:focus {
    outline: none;
    border-color: var(--primary);
}

/* Action Buttons */
.ttbp-action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ttbp_button_secondary {
    background: #f5f5f5;
    color: #121212;
    border: 1px solid #ddd;
}

.ttbp_button_secondary:hover {
    background: #e8e8e8;
}

/* Main Content Area */
.ttbp-starter-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

/* Starter Container Enhancements */
.ttbp_starter_container {
    background: transparent;
    padding: 0;
}

.ttbp_starter_group {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 6px solid var(--primary);
}

.ttbp_teetime {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.ttbp_single_booking {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ttbp_single_booking:last-child {
    margin-bottom: 0;
}

.ttbp_booking_section {
    padding: 20px;
    border-right: 1px solid #edf2f7;
}

.ttbp_booking_section:last-child {
    border-right: none;
}

.ttbp_booking_section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin: 0 0 15px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input Styling */
.ttbp_input_group {
    margin-bottom: 12px;
}

.ttbp_input_group label {
    display: block;
    font-size: 11px;
    color: #a0aec0;
    margin-bottom: 4px;
    font-weight: 600;
}

.ttbp_editable {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #2d3748;
}

.ttbp_editable:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    outline: none;
}

/* Row Group for compact selects */
.ttbp_row_group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Players Grid */
.ttbp_players_grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ttbp_player_row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.ttbp_player_row.ttbp_slot_extra {
    opacity: 0.6;
}

.ttbp_player_row input {
    background: transparent;
    border: none;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
}

.ttbp_player_row input:focus {
    background: transparent;
    box-shadow: none;
}

/* Payment Toggle */
.ttbp_pay_toggle {
    cursor: pointer;
    font-size: 12px;
    color: #cbd5e0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.ttbp_pay_toggle.paid {
    color: #48bb78;
}

.ttbp_pay_toggle:hover {
    transform: scale(1.2);
}

/* Ops & Tracking Column */
.ttbp_ops_tracking {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ttbp_cart_codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ttbp_cc_group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0 10px;
    height: 38px;
}

.ttbp_cc_group .ttbp_editable {
    border: none;
    background: transparent;
    padding: 8px 0;
    width: 100%;
    box-shadow: none;
}

.ttbp_cc_img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Turn Times Grid */
.ttbp_turn_times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

button.turn_btn {
    padding: 8px 4px;
    height: 50px;
}

/* Pace Display */
.ttbp_pace_display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
}

.pace_item {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.pace_item span {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 700;
}

.pace_item strong {
    font-size: 13px;
    color: #1e293b;
}

.pace_item.total strong {
    color: var(--primary);
}

/* Full Width Notes Section */
.ttbp_booking_notes {
    grid-column: span 3;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
}

.ttbp_booking_notes textarea {
    height: 60px;
    resize: none;
}

/* Animated Feedback */
.ttbp_saving {
    opacity: 0.7;
    pointer-events: none;
}

.ttbp_save_success {
    border-color: #48bb78 !important;
    background: #f0fff4 !important;
}

.ttbp_save_error {
    border-color: #f56565 !important;
    background: #fff5f5 !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ttbp_single_booking {
        grid-template-columns: 1fr 1fr;
    }

    .ttbp_booking_notes {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .ttbp_single_booking {
        grid-template-columns: 1fr;
    }

    .ttbp_booking_section {
        border-right: none;
        border-bottom: 1px solid #edf2f7;
    }

    .ttbp_booking_notes {
        grid-column: span 1;
    }
}

/* Print Styles */
/* Hidden by default, shown only on print */
.ttbp_print_only {
    display: none;
}

@media print {
    @page {
        margin: 1cm;
        size: A4 landscape;
        /* Landscape is better for 9 columns */
    }

    body {
        background: white !important;
        font-size: 10pt;
    }

    /* Hide screen elements */
    .ttbp-starter-header,
    .ttbp_starter_container,
    .ttbp-starter-header-content,
    .no-print {
        display: none !important;
    }

    /* Show print elements */
    .ttbp-starter-content {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .ttbp_print_only {
        display: block !important;
    }

    .ttbp_print_header {
        text-align: center;
        margin-bottom: 20px;
    }

    .ttbp_print_header h1 {
        font-size: 24pt;
        margin: 0;
        color: #000;
    }

    .ttbp_print_header h2 {
        font-size: 16pt;
        margin: 5px 0 0 0;
        color: #444;
    }

    /* Grid Table Styles */
    .ttbp_starter_print_table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .ttbp_starter_print_table th,
    .ttbp_starter_print_table td {
        border: 1px solid #000;
        padding: 8px 4px;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ttbp_starter_print_table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        font-weight: bold;
        font-size: 11pt;
    }

    .ttbp_starter_print_table td {
        font-size: 10pt;
    }

    .ttbp_starter_print_table td:first-child {
        width: 80px;
        font-weight: bold;
    }

    /* Specialized Row Styles */
    .ttbp_print_squeeze_row td {
        background-color: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        font-style: italic;
        height: 35px;
    }

    .ttbp_print_notes_row td {
        height: 25px;
        border-top: none !important;
    }

    .ttbp_row_label {
        font-size: 10pt !important;
        color: #000;
        text-align: left !important;
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        font-weight: bold;
    }

    .ttbp_row_time {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }

    /* Print Player Meta */
    .ttbp_print_p_meta {
        font-size: 8pt;
        color: #444;
        margin-top: 2px;
        font-weight: normal;
    }

    .ttbp_print_p_name {
        font-weight: bold;
    }

    .ttbp_print_slot_locked {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }

    /* Force visibility of page elements */
    .ttbp_print_only * {
        visibility: visible !important;
    }
}

/* Screen Player Meta */
.ttbp_player_meta {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
    font-size: 0.85em;
}

.ttbp_p_amount {
    font-weight: 600;
    color: var(--text-main, #333);
}

.ttbp_p_status {
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    font-size: 0.8em;
    text-transform: uppercase;
}

.ttbp_p_status.paid {
    background: #e6ffed;
    color: #22863a;
    border: 1px solid #c6ffda;
}

.ttbp_p_status.due {
    background: #fff5f5;
    color: #cb2431;
    border: 1px solid #ffd8d8;
}

.ttbp_empty_booking {
    border-style: dashed !important;
    background: #fbfbfb !important;
}

/* Empty Slot Styles */
.ttbp_empty_slot {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    border-style: dashed !important;
    min-height: 80px;
}

.ttbp_empty_label {
    color: #999;
    font-weight: 500;
    font-style: italic;
    font-size: 14px;
}

.ttbp_cc_img svg {
    max-width: 100%;
    height: auto;
    width: 16px;
    /* Enforce specific width if needed */
}

/* Check-in Badge Styles */
.ttbp_checkin_badge {
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
}

.ttbp_checked_in {
    border-color: #28a745 !important;
    color: #28a745 !important;
    background-color: #f0fff4 !important;
}

select.player_checkin_status.ttbp_checked_in {
    font-weight: bold;
}