/**
 * Gravity Forms Course Calendar - Frontend Styles
 */

/* Calendar Container */
.gf-calendar-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Navigation */
.gf-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gf-calendar-nav button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.gf-calendar-nav button:hover {
    background: #005a87;
}

.gf-cal-month-year {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Legend */
.gf-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gf-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.gf-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.gf-legend-color.gf-status-available {
    background: #d4edda;
    border-color: #28a745;
}

.gf-legend-color.gf-status-nearly-full {
    background: #fff3cd;
    border-color: #ffc107;
}

.gf-legend-color.gf-status-full {
    background: #f8d7da;
    border-color: #dc3545;
}

.gf-legend-color.gf-blocked {
    background: #e8e8e8;
    border-color: #999;
}

/* Calendar Grid */
.gf-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #ddd;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.gf-cal-day-header {
    background: #343a40;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 12px 4px;
    font-size: 13px;
}

.gf-cal-day {
    background: white;
    min-height: 100px;
    padding: 8px 6px;
    font-size: 12px;
    position: relative;
    transition: box-shadow 0.2s;
}

.gf-cal-day.clickable {
    cursor: pointer;
}

.gf-cal-day.clickable:hover {
    box-shadow: inset 0 0 0 2px #0073aa;
}

.gf-cal-day.today {
    border: 2px solid #0073aa;
    box-shadow: 0 0 8px rgba(0, 115, 170, 0.3);
}

.gf-cal-day.other-month {
    background: #f9f9f9;
    color: #999;
}

.gf-cal-day.other-month .gf-cal-day-number {
    opacity: 0.4;
}

.gf-cal-day.weekend,
.gf-cal-day.blocked {
    background: #e8e8e8;
    color: #666;
    cursor: not-allowed;
}

.gf-cal-day-number {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

/* Event Styles */
.gf-cal-event {
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.gf-cal-event.clickable {
    cursor: pointer;
}

.gf-cal-event.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gf-cal-event.gf-status-available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.gf-cal-event.gf-status-nearly-full {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.gf-cal-event.gf-status-full {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: not-allowed;
}

.gf-event-title {
    font-weight: bold;
    margin-bottom: 2px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gf-event-seats {
    font-size: 10px;
    opacity: 0.9;
}

.gf-blocked-label {
    font-size: 9px;
    color: #666;
    margin-top: 4px;
    font-weight: bold;
}

.gf-request-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #0073aa;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.gf-cal-day.empty-day:hover .gf-request-hint {
    opacity: 1;
}

/* Course Details Section */
.gf-course-details,
.gf-request-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.gf-selected-course h3,
.gf-request-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.gf-selected-course p {
    margin: 10px 0;
    font-size: 14px;
}

.gf-add-attendees-btn,
.gf-change-selection-btn {
    margin-top: 15px;
    margin-right: 10px;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.gf-add-attendees-btn:hover {
    background: #005a87;
}

.gf-change-selection-btn {
    background: #6c757d;
}

.gf-change-selection-btn:hover {
    background: #5a6268;
}

/* Attendees Section */
.gf-attendees-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.gf-attendees-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.gf-attendees-form > p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.gf-attendee-row {
    padding: 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.gf-attendee-row h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
}

.gf-form-row {
    margin-bottom: 15px;
}

.gf-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.gfield_required {
    color: #dc3545;
    margin-left: 2px;
}

.gf-form-row input[type="text"],
.gf-form-row input[type="email"],
.gf-form-row input[type="tel"],
.gf-form-row input[type="number"],
.gf-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gf-form-row input:focus,
.gf-form-row select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.gf-form-row small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.gf-add-attendee-row {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.gf-add-attendee-row:hover {
    background: #218838;
}

.gf-remove-attendee {
    margin-top: 10px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.gf-remove-attendee:hover {
    background: #c82333;
}

/* Request Form */
.gf-request-form select,
.gf-request-form input {
    max-width: 400px;
}

.gf-cal-event.booked-out,
.gf-cal-event.gf-status-full {
    background-color: #dc3545;
    color: white;
    cursor: not-allowed;
    opacity: 0.9;
}

.gf-cal-event.booked-out:hover,
.gf-cal-event.gf-status-full:hover {
    background-color: #c82333;
    transform: none;
}

.gf-cal-event.booked-out .gf-event-seats,
.gf-cal-event.gf-status-full .gf-event-seats {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gf-calendar-grid {
        font-size: 11px;
    }
    
    .gf-cal-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .gf-cal-day-number {
        font-size: 12px;
    }
    
    .gf-cal-event {
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .gf-event-title {
        font-size: 10px;
    }
    
    .gf-event-seats {
        font-size: 9px;
    }
    
    .gf-calendar-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .gf-calendar-legend {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .gf-cal-day {
        min-height: 60px;
    }
    
    .gf-request-hint {
        display: none;
    }
}