/**
 * Availability Calendar Styles
 * Beautiful styling for mentor availability management and student booking calendar
 *
 * @package EduBooking_Pro
 * @version 2.3.0
 */

/* ==========================================================================
   Availability Manager Container
   ========================================================================== */

.ebp-availability-manager {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.ebp-availability-manager h2 {
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ebp-availability-manager h2 .dashicons {
    color: #10b981;
    width: 32px;
    height: 32px;
    font-size: 32px;
}

.ebp-availability-description {
    color: #64748b;
    font-size: 15px;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

/* ==========================================================================
   Weekly Schedule Editor
   ========================================================================== */

.ebp-weekly-schedule {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.ebp-weekly-schedule h3 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebp-weekly-schedule h3 .dashicons {
    color: #10b981;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ebp-schedule-grid {
    display: grid;
    gap: 16px;
}

/* Day Row */
.ebp-schedule-day {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}

.ebp-schedule-day:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.ebp-schedule-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.ebp-day-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ebp-day-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #10b981;
}

.ebp-day-label {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
}

.ebp-day-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

/* Time Slots Container */
.ebp-time-slots-container {
    display: none;
}

.ebp-schedule-day.active .ebp-time-slots-container {
    display: block;
}

.ebp-time-slot-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px 80px auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.ebp-time-slot-row:hover {
    background: #f1f5f9;
}

.ebp-time-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ebp-time-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ebp-time-input-group input[type="time"],
.ebp-time-input-group input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.3s ease;
}

.ebp-time-input-group input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.ebp-add-slot-btn,
.ebp-remove-slot-btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ebp-add-slot-btn {
    background: #10b981;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    gap: 6px;
    margin-top: 8px;
}

.ebp-add-slot-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ebp-remove-slot-btn {
    background: #ef4444;
    color: #ffffff;
    width: 32px;
    height: 32px;
}

.ebp-remove-slot-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.ebp-remove-slot-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Save Schedule Button */
.ebp-save-schedule-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    margin-top: 20px;
}

.ebp-save-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.ebp-save-schedule-btn:active {
    transform: translateY(0);
}

.ebp-save-schedule-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Booking Calendar (Student View)
   ========================================================================== */

.ebp-booking-calendar {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ebp-booking-calendar h3 {
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebp-booking-calendar h3 .dashicons {
    color: #667eea;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* Calendar Header */
.ebp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: #ffffff;
}

.ebp-calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ebp-calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ebp-calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ebp-calendar-nav-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ebp-calendar-month {
    font-size: 20px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

/* Calendar Grid */
.ebp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.ebp-calendar-day-header {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ebp-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
}

.ebp-calendar-day:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: scale(1.05);
}

.ebp-calendar-day.other-month {
    color: #cbd5e1;
    background: #f8fafc;
}

.ebp-calendar-day.today {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 700;
}

.ebp-calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    font-weight: 700;
}

.ebp-calendar-day.has-slots::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.ebp-calendar-day.selected.has-slots::after {
    background: #ffffff;
}

.ebp-calendar-day.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.ebp-calendar-day.disabled:hover {
    transform: none;
    border-color: #e2e8f0;
}

/* ==========================================================================
   Time Slots Selection
   ========================================================================== */

.ebp-time-slots-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.ebp-time-slots-section h4 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebp-time-slots-section h4 .dashicons {
    color: #667eea;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.ebp-selected-date-display {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 15px;
}

.ebp-selected-date-display .dashicons {
    color: #667eea;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ebp-selected-date-display strong {
    color: #1e293b;
    font-weight: 600;
}

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

.ebp-time-slot-btn {
    padding: 14px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.ebp-time-slot-btn:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ebp-time-slot-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ebp-time-slot-btn.booked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
}

.ebp-time-slot-btn.booked:hover {
    transform: none;
    box-shadow: none;
}

.ebp-slot-time {
    font-size: 16px;
}

.ebp-slot-duration {
    font-size: 12px;
    opacity: 0.8;
}

.ebp-time-slots-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
}

.ebp-time-slots-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.ebp-time-slots-empty p {
    margin: 0;
    font-size: 15px;
}

/* ==========================================================================
   Booking Summary
   ========================================================================== */

.ebp-booking-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
    border: 2px solid #e2e8f0;
}

.ebp-booking-summary h4 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebp-booking-summary h4 .dashicons {
    color: #667eea;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.ebp-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
}

.ebp-summary-item:last-child {
    border-bottom: none;
}

.ebp-summary-label {
    color: #64748b;
    font-weight: 500;
}

.ebp-summary-value {
    color: #1e293b;
    font-weight: 600;
}

.ebp-summary-total {
    padding: 16px 0 0 0;
    border-top: 2px solid #cbd5e1;
    margin-top: 12px;
}

.ebp-summary-total .ebp-summary-value {
    font-size: 24px;
    color: #667eea;
}

.ebp-book-now-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 20px;
}

.ebp-book-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ebp-book-now-btn:active {
    transform: translateY(0);
}

.ebp-book-now-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ebp-book-now-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Reschedule Interface (Mentor)
   ========================================================================== */

.ebp-reschedule-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.ebp-reschedule-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ebp-reschedule-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.ebp-reschedule-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    padding: 24px 30px;
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ebp-reschedule-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebp-reschedule-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ebp-reschedule-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ebp-reschedule-modal-body {
    padding: 30px;
}

.ebp-current-booking-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.ebp-current-booking-info h4 {
    color: #92400e;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ebp-current-booking-info p {
    color: #78350f;
    font-size: 14px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebp-current-booking-info .dashicons {
    color: #f59e0b;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ebp-calendar-loading,
.ebp-slots-loading {
    text-align: center;
    padding: 40px 20px;
}

.ebp-calendar-loading .spinner,
.ebp-slots-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ebp-calendar-loading p,
.ebp-slots-loading p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* ==========================================================================
   Alert Messages
   ========================================================================== */

.ebp-calendar-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

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

.ebp-calendar-alert .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ebp-calendar-alert.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.ebp-calendar-alert.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.ebp-calendar-alert.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .ebp-time-slot-row {
        grid-template-columns: 1fr 1fr 100px 70px auto;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .ebp-availability-manager,
    .ebp-booking-calendar {
        padding: 20px;
    }

    .ebp-availability-manager h2,
    .ebp-booking-calendar h3 {
        font-size: 22px;
    }

    .ebp-weekly-schedule {
        padding: 16px;
    }

    .ebp-time-slot-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ebp-remove-slot-btn {
        align-self: flex-end;
    }

    .ebp-calendar-header {
        flex-direction: column;
        gap: 16px;
    }

    .ebp-calendar-month {
        order: -1;
    }

    .ebp-calendar-grid {
        gap: 4px;
    }

    .ebp-calendar-day {
        font-size: 14px;
    }

    .ebp-time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .ebp-booking-summary {
        padding: 16px;
    }

    .ebp-reschedule-modal-content {
        max-height: 95vh;
    }

    .ebp-reschedule-modal-header,
    .ebp-reschedule-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ebp-availability-manager,
    .ebp-booking-calendar {
        padding: 16px;
        border-radius: 8px;
    }

    .ebp-availability-manager h2,
    .ebp-booking-calendar h3 {
        font-size: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .ebp-weekly-schedule h3,
    .ebp-booking-summary h4 {
        font-size: 16px;
    }

    .ebp-schedule-day {
        padding: 12px;
    }

    .ebp-calendar-day-header {
        font-size: 11px;
        padding: 8px 2px;
    }

    .ebp-calendar-day {
        font-size: 13px;
    }

    .ebp-time-slots-grid {
        grid-template-columns: 1fr;
    }

    .ebp-time-slot-btn {
        flex-direction: row;
        justify-content: space-between;
    }

    .ebp-summary-item {
        font-size: 14px;
    }

    .ebp-summary-total .ebp-summary-value {
        font-size: 20px;
    }

    .ebp-book-now-btn {
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ebp-save-schedule-btn,
    .ebp-add-slot-btn,
    .ebp-remove-slot-btn,
    .ebp-calendar-nav,
    .ebp-book-now-btn,
    .ebp-reschedule-modal {
        display: none !important;
    }

    .ebp-availability-manager,
    .ebp-booking-calendar,
    .ebp-booking-summary {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ==========================================================================
   Dark Mode Support (Ready for theme integration)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ebp-availability-manager,
    .ebp-booking-calendar {
        background: #1e293b;
    }

    .ebp-availability-manager h2,
    .ebp-booking-calendar h3,
    .ebp-weekly-schedule h3 {
        color: #f1f5f9;
    }

    .ebp-availability-description {
        color: #cbd5e1;
    }

    .ebp-weekly-schedule,
    .ebp-schedule-day,
    .ebp-time-slot-row {
        background: #334155;
        border-color: #475569;
    }

    .ebp-day-label {
        color: #f1f5f9;
    }

    .ebp-time-input-group input[type="time"],
    .ebp-time-input-group input[type="number"] {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }

    .ebp-calendar-day {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .ebp-calendar-day:hover {
        background: #475569;
    }

    .ebp-time-slot-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .ebp-booking-summary {
        background: #334155;
        border-color: #475569;
    }

    .ebp-summary-label,
    .ebp-summary-value {
        color: #f1f5f9;
    }
}
