/**
 * Public Forms CSS
 * Styles for public form display and calendar widget
 */

/* General Form Styles */
.form-container {
    max-width: 700px;
    margin: 50px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.form-header h2 {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

/* Form Fields */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Error and Success Messages */
.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

.success-message {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    margin-right: 12px;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-outline-secondary {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline-secondary:hover {
    background-color: #f9fafb;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Multi-step Forms */
.multi-step-form .step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.multi-step-form .step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-progress {
    display: flex;
    margin-bottom: 32px;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 4px;
}

.step-indicator {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.step-indicator.active {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.step-indicator.completed {
    background-color: #059669;
    color: white;
}

/* Calendar Widget Styles */
.calendar-widget-container {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background-color: #ffffff;
    margin-top: 16px;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-navigation h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.calendar-grid {
    margin-bottom: 24px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.past {
    color: #d1d5db;
    cursor: not-allowed;
}

.calendar-day.unavailable {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day.available {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.calendar-day.available:hover {
    background-color: #dcfce7;
    transform: scale(1.05);
}

.calendar-day.selected {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: scale(1.1);
}

.calendar-day.today {
    font-weight: 700;
    position: relative;
}

.calendar-day.today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: currentColor;
    border-radius: 50%;
}

/* Time Slots */
.time-slots-container {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

.time-slots-title {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.time-slot {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
    font-weight: 500;
}

.time-slot:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.time-slot.selected {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.time-slot small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Duration Selector */
.duration-selector {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.duration-selector label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.duration-select {
    max-width: 200px;
}

/* Selected Appointment */
.selected-appointment {
    margin-top: 24px;
    padding: 20px;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.selected-appointment h6 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
}

.selected-appointment p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #1f2937;
}

.selected-appointment p:last-child {
    margin-bottom: 0;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-style: italic;
}

.error {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        margin: 20px;
        padding: 20px;
    }
    
    .calendar-grid {
        font-size: 14px;
    }
    
    .calendar-day {
        font-size: 13px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .step-progress {
        flex-direction: column;
        gap: 8px;
    }
    
    .step-indicator {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .form-container {
        margin: 10px;
        padding: 16px;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .calendar-navigation h5 {
        font-size: 16px;
    }
    
    .btn {
        width: 100%;
        margin: 4px 0;
    }
    
    .btn-secondary {
        margin-right: 0;
    }
    
    .time-slots-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .calendar-widget-container,
    .btn,
    .calendar-navigation {
        display: none;
    }
    
    .selected-appointment {
        background: none;
        border: 1px solid #000;
    }
}