/* Tournament Signup Form Styles */

/* Global box-sizing reset for form elements */
.golf-tournament-signup *,
.golf-tournament-signup *::before,
.golf-tournament-signup *::after {
    box-sizing: border-box;
}

.golf-tournament-signup {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.golf-tournament-details {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tournament-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    padding: 24px;
}

.tournament-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.tournament-title {
    font-size: 28px;
    color: #2c3e50;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.tournament-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    color: #495057;
}

.meta-item i {
    width: 20px;
    margin-right: 8px;
    color: #007cba;
}

.tournament-status-open {
    color: #28a745;
    font-weight: 500;
}

.tournament-status-closed,
.tournament-status-auto_closed {
    color: #dc3545;
    font-weight: 500;
}

.tournament-notes {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.tournament-notes h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
}

.notes-content {
    color: #495057;
    line-height: 1.5;
}

.tournament-sessions {
    padding: 24px;
    border-top: 1px solid #e9ecef;
}

.tournament-sessions h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 20px;
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.session-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.session-card.available {
    border-color: #28a745;
    background: #f8fff9;
}

.session-card.full {
    border-color: #dc3545;
    background: #fff5f5;
    opacity: 0.7;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.session-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.session-price {
    font-weight: 600;
    color: #007cba;
    font-size: 18px;
}

.session-capacity {
    font-size: 14px;
    color: #6c757d;
}

.entries-count {
    font-weight: 600;
    color: #2c3e50;
}

.remaining {
    color: #28a745;
    font-weight: 500;
}

.session-full {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
}

/* Signup Form Styles */
.golf-signup-form-container {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.golf-signup-form-container h3 {
    margin: 0 0 24px 0;
    color: #2c3e50;
    font-size: 22px;
    text-align: center;
}

.signup-step h4 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.form-section {
    margin-bottom: 24px;
}

.section-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: #dc3545;
}

.session-options {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.selected-session-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.selected-session-info h5 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.selected-session-details {
    color: #495057;
    font-size: 14px;
}

.player-count-options {
    display: grid;
    gap: 12px;
}

.session-option,
.player-count-option,
.player-type-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.player-count-option .option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 12px;
}

.player-count-option .option-title {
    font-weight: 500;
    flex: 1;
}

.player-count-option .option-price {
    font-weight: 600;
    color: #007cba;
    font-size: 16px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.session-option.session-full {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #dc3545;
    background: #f8d7da;
}

.session-option.session-full input[type="radio"] {
    cursor: not-allowed;
}

.session-option:hover,
.player-count-option:hover,
.player-type-option:hover {
    border-color: #007cba;
    background: #f8fbff;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.session-option input[type="radio"]:checked + .option-content,
.player-count-option input[type="radio"]:checked + span,
.player-type-option input[type="radio"]:checked + span {
    color: #007cba;
    font-weight: 600;
}

.session-option input[type="radio"]:checked {
    accent-color: #007cba;
}

.session-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f8fbff;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.2);
}

.session-option input[type="radio"],
.player-count-option input[type="radio"],
.player-type-option input[type="radio"] {
    margin-right: 12px;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
}

.option-title {
    font-weight: 600;
    flex: 1;
    font-size: 16px;
    color: #2c3e50;
}

.option-time {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.option-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.option-price {
    font-weight: 700;
    color: #007cba;
    font-size: 18px;
}

.option-member-price {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
}

.option-member-price small {
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.option-full {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.player-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.player-section h5 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.player-type-selection {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.player-type-card {
    display: block;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.player-type-card:hover {
    border-color: #007cba;
    background: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.player-type-card.selected {
    border-color: #007cba;
    background: #007cba;
    color: white;
}

.player-type-card.selected .type-title,
.player-type-card.selected .type-description {
    color: white;
}

.type-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.type-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

.type-description {
    font-size: 13px;
    color: #6c757d;
    display: block;
}

.field-group {
    margin-bottom: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-group label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    font-size: 13px;
}

.field-group input,
.field-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.field-help {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Member Search Autocomplete Styles */
.member-search-container {
    position: relative;
}

.member-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.member-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.member-result:last-child {
    border-bottom: none;
}

.member-result:hover {
    background-color: #f8f9fa;
}

.member-result.no-results {
    color: #6c757d;
    font-style: italic;
    cursor: default;
}

.member-result.no-results:hover {
    background-color: transparent;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.member-details {
    font-size: 12px;
    color: #6c757d;
}

.registration-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h5 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
}

.summary-item .label {
    color: #6c757d;
    font-weight: 500;
}

.summary-item .value {
    color: #2c3e50;
    font-weight: 600;
}

.pricing-breakdown {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 20px;
}

.pricing-breakdown .summary-item {
    padding: 6px 0;
}

.pricing-breakdown .summary-total {
    border-top: 2px solid #2c3e50;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
}

.pricing-breakdown .summary-total .value {
    color: #007cba;
    font-size: 18px;
}

.pricing-line-member .value {
    color: #28a745 !important;
}

.payment-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.payment-note p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled,
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d !important;
    color: #fff !important;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #005a87;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
}

.form-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-result {
    padding: 32px 24px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
}

.form-result.success {
    background: var(--msga-success-light, #edf7f1);
    border: 1px solid var(--msga-success, #2d8a4e);
    color: var(--msga-navy, #0b1a3b);
}

.form-result.error {
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.reg-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--msga-success, #2d8a4e);
    color: #fff;
    font-size: 1.75rem;
    margin: 0 auto 16px;
    line-height: 1;
}

.form-result.success .result-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--msga-navy, #0b1a3b);
    margin: 0 0 10px;
}

.form-result.success .result-content p {
    font-size: 0.9375rem;
    color: var(--msga-gray-600, #495057);
    margin: 0;
    line-height: 1.6;
}

.login-required,
.registration-closed {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.current-roster {
    margin-top: 32px;
}

.current-roster h3 {
    color: #2c3e50;
    margin-bottom: 16px;
}

.field-error {
    color: var(--wp-golf-error, #dc3545);
    font-size: 12px;
    margin-top: 4px;
}

.golf-form-control.error,
input.field-has-error,
select.field-has-error {
    border-color: var(--wp-golf-error, #dc3545);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .tournament-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .field-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .summary-item {
        flex-direction: column;
        gap: 2px;
    }
    
    .sessions-grid {
        grid-template-columns: 1fr;
    }
    
    .player-type-selection {
        grid-template-columns: 1fr;
    }
}

/* Waitlist Styles */
.session-option.session-waitlist {
    border-color: #f0ad4e;
    background: #fef9e7;
}

.session-option.session-waitlist:hover {
    border-color: #ec971f;
    background: #fdf3d7;
}

.option-waitlist-badge {
    display: inline-block;
    background: #f0ad4e;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.session-card.waitlist {
    border-color: #f0ad4e;
    background: linear-gradient(135deg, #fef9e7 0%, #fdf3d7 100%);
}

.session-waitlist-info {
    color: #856404;
    font-weight: 600;
    font-size: 13px;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(240, 173, 78, 0.15);
    border-radius: 4px;
    display: inline-block;
}

.waitlist-notice {
    background: #fef9e7;
    border: 1px solid #f0ad4e;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #856404;
}

.waitlist-notice p {
    margin: 0;
    line-height: 1.5;
}

.spouse-dinner-option {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f7f0;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.spouse-dinner-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
}

.spouse-dinner-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #28a745;
    cursor: pointer;
}

.pricing-line-spouse .label {
    font-style: italic;
}
