/**
 * GAA Pitch Booking - Public Styles
 */

/* Wrapper */
.gpb-public-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Calendar Controls */
.gpb-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gpb-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gpb-filter-group label {
    font-weight: 500;
    color: #333;
}

.gpb-filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 180px;
}

/* Legend */
.gpb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.gpb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.gpb-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Pending Note */
.gpb-pending-note {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
}

/* Calendar */
#gpb-public-calendar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#gpb-public-calendar .fc-event {
    cursor: pointer;
    border: none;
    padding: 2px 5px;
}

#gpb-public-calendar .fc-daygrid-event {
    border-radius: 3px;
}

/* Pending events - striped pattern */
#gpb-public-calendar .gpb-pending-event {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.3) 5px,
        rgba(255,255,255,0.3) 10px
    );
}

#gpb-public-calendar .gpb-pending-event .fc-event-title::after {
    content: ' (Pending)';
    font-size: 0.85em;
    opacity: 0.8;
}

/* Booking Section */
.gpb-booking-section {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 2px solid #0033A0;
}

.gpb-booking-section h3 {
    margin-top: 0;
    color: #0033A0;
}

.gpb-selected-slot {
    padding: 12px;
    background: #e7f0ff;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Booking Form */
.gpb-booking-form {
    max-width: 600px;
}

.gpb-form-row {
    margin-bottom: 20px;
}

.gpb-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.gpb-form-row .required {
    color: #dc3545;
}

.gpb-form-row input[type="text"],
.gpb-form-row input[type="date"],
.gpb-form-row input[type="time"],
.gpb-form-row select,
.gpb-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.gpb-form-row input:focus,
.gpb-form-row select:focus,
.gpb-form-row textarea:focus {
    outline: none;
    border-color: #0033A0;
}

.gpb-time-row {
    display: flex;
    gap: 20px;
}

.gpb-time-field {
    flex: 1;
}

/* Recurring Section */
.gpb-recurring-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.gpb-recurring-section input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.gpb-recurring-fields {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.gpb-note {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin: 10px 0 0 0;
}

/* Buttons */
.gpb-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.gpb-btn-primary {
    background: #0033A0;
    color: #fff;
}

.gpb-btn-primary:hover {
    background: #002878;
    color: #fff;
}

.gpb-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.gpb-btn-secondary:hover {
    background: #5a6268;
}

.gpb-btn-small {
    padding: 5px 12px;
    font-size: 13px;
}

.gpb-btn-cancel {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.gpb-btn-cancel:hover {
    background: #dc3545;
    color: #fff;
}

.gpb-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Message */
.gpb-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.gpb-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.gpb-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.gpb-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Prompt */
.gpb-login-prompt {
    text-align: center;
    padding: 20px;
}

.gpb-login-prompt a {
    color: #0033A0;
    font-weight: 500;
}

.gpb-login-required {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* Modal */
.gpb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gpb-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.gpb-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.gpb-modal-close:hover {
    color: #000;
}

.gpb-modal h3 {
    margin-top: 0;
    padding-right: 30px;
}

#gpb-public-booking-details p {
    margin: 10px 0;
}

#gpb-public-booking-details strong {
    display: inline-block;
    min-width: 80px;
}

/* Status Badges */
.gpb-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.gpb-status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.gpb-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.gpb-status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.gpb-status-badge.cancelled {
    background: #e2e3e5;
    color: #383d41;
}

/* My Bookings */
.gpb-my-bookings h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.gpb-my-bookings h3:first-child {
    margin-top: 0;
}

.gpb-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gpb-booking-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid #28a745;
}

.gpb-booking-card.pending {
    border-left-color: #ffc107;
}

.gpb-booking-card.cancelled,
.gpb-booking-card.rejected {
    border-left-color: #dc3545;
    opacity: 0.7;
}

.gpb-booking-card.past {
    opacity: 0.6;
}

.gpb-booking-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 10px;
    background: #0033A0;
    color: #fff;
    border-radius: 8px;
}

.gpb-booking-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.gpb-booking-month {
    font-size: 14px;
    text-transform: uppercase;
}

.gpb-booking-details {
    flex: 1;
}

.gpb-booking-details h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.gpb-booking-time {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
}

.gpb-booking-type {
    margin: 0;
    color: #0033A0;
    font-weight: 500;
}

.gpb-booking-description {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 14px;
}

.gpb-booking-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Recurring Groups */
.gpb-recurring-group {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    overflow: hidden;
}

.gpb-recurring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.gpb-recurring-header:hover {
    background: #f8f9fa;
}

.gpb-recurring-summary h4 {
    margin: 0 0 5px 0;
}

.gpb-recurring-summary p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.gpb-recurring-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gpb-expand-icon {
    transition: transform 0.2s;
    color: #666;
}

.gpb-recurring-group.expanded .gpb-expand-icon {
    transform: rotate(180deg);
}

.gpb-recurring-dates {
    display: none;
    padding: 0 20px 20px;
}

.gpb-recurring-group.expanded .gpb-recurring-dates {
    display: block;
}

.gpb-recurring-dates table {
    width: 100%;
    border-collapse: collapse;
}

.gpb-recurring-dates th,
.gpb-recurring-dates td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.gpb-recurring-dates th {
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

.gpb-recurring-dates tr.past {
    opacity: 0.6;
}

/* Empty State */
.gpb-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gpb-empty-state p {
    margin-bottom: 20px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .gpb-calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .gpb-legend {
        justify-content: center;
    }

    .gpb-time-row {
        flex-direction: column;
        gap: 15px;
    }

    .gpb-booking-card {
        flex-direction: column;
        gap: 15px;
    }

    .gpb-booking-date {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        padding: 8px 12px;
    }

    .gpb-booking-status {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .gpb-recurring-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .gpb-recurring-status {
        justify-content: space-between;
    }
}
