/**
 * MarketDope Service Booking Calendar Styles - Complete Redesign
 * Matches the beautiful blue gradient design from calender-sample.png
 *
 * @package MarketDope_Service_Manager
 * @since 2.6.10
 */

/* ============================================
   MAIN CALENDAR CONTAINER - Blue Gradient
   ============================================ */
.md-calendar-container {
    max-width: 800px;
    margin: 50px auto;
    background: linear-gradient(135deg, #4A90E2 0%, #5BA3F5 50%, #6B9EE8 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(74, 144, 226, 0.4);
    overflow: visible;
    position: relative;
}

/* ============================================
   HEADER - "Pick date & time:"
   ============================================ */
.md-calendar-header {
    text-align: center;
    padding: 50px 30px 30px;
    background: transparent;
}

.md-calendar-header h3 {
    margin: 0;
    font-size: 42px;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CALENDAR WRAPPER
   ============================================ */
.md-calendar-wrapper {
    position: relative;
    min-height: 550px;
    padding-bottom: 30px;
    background: transparent;
    overflow: visible;
}

.md-calendar-section {
    padding: 40px 50px;
    position: relative;
    z-index: 1;
}

/* ============================================
   DATEPICKER - Clean White on Blue
   ============================================ */
#md-datepicker {
    background: transparent;
    border: none;
    box-shadow: none;
}

.ui-datepicker {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Month/Year Header */
.ui-datepicker-header {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 30px;
    margin: 0 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ui-datepicker-title {
    font-size: 28px;
    font-weight: 400;
    color: #ffffff;
    flex: 1;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Navigation Arrows */
.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: static;
    transform: none;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
    display: none;
}

.ui-datepicker-prev::before {
    content: "\2039";
    font-size: 32px;
    color: #ffffff;
    font-weight: 300;
    line-height: 1;
}

.ui-datepicker-next::before {
    content: "\203A";
    font-size: 32px;
    color: #ffffff;
    font-weight: 300;
    line-height: 1;
}

/* Calendar Table */
.ui-datepicker-calendar {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Day Headers (M T W T F S S) */
.ui-datepicker-calendar thead th {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-size: 16px;
    padding: 0 0 20px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Date Cells */
.ui-datepicker-calendar tbody td {
    padding: 5px;
    text-align: center;
}

.ui-datepicker-calendar tbody td a,
.ui-datepicker-calendar tbody td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto;
    text-decoration: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: 2px solid transparent;
}

/* Hover State */
.ui-datepicker-calendar tbody td a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Today's Date */
.ui-datepicker-calendar tbody td.ui-datepicker-today a {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Disabled Dates (past dates, unavailable) */
.ui-datepicker-calendar tbody td.ui-state-disabled span {
    color: rgba(255, 255, 255, 0.3);
    background: transparent;
    cursor: not-allowed;
}

/* Selected Date - White Circle with Border */
.ui-datepicker-calendar tbody td.ui-datepicker-current-day a,
.ui-datepicker-calendar tbody td.ui-state-active a {
    background: rgba(255, 255, 255, 0.95);
    color: #4A90E2;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Dates from other months */
.ui-datepicker-calendar tbody td.ui-datepicker-other-month span {
    color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   TIME SLOTS OVERLAY - Blue Panel
   ============================================ */
.md-time-slots-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 680px;
    background: rgba(74, 144, 226, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.md-time-slots-overlay h4 {
    display: none;
}

/* Time Slots Scroll Container */
.time-slots-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.time-slots-scroll::-webkit-scrollbar {
    width: 8px;
}

.time-slots-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.time-slots-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.time-slots-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Time Slots Grid - 2 Columns */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Individual Time Slot Button */
.time-slot {
    padding: 16px 20px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.time-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Selected Time Slot - Filled White */
.time-slot.selected {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3d73 !important;
    border-color: rgba(255, 255, 255, 1);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Selected Time Slot Hover - Keep text readable */
.time-slot.selected:hover {
    background: rgba(255, 255, 255, 1);
    color: #1e3d73 !important;
    border-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Unavailable/Booked Slots */
.time-slot.unavailable {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.time-slot.unavailable:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
}

/* Loading/Error Messages in Time Slots */
#md-time-slots-container .loading,
#md-time-slots-container .error,
#md-time-slots-container .no-slots,
#md-time-slots-container .md-instruction {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
}

/* ============================================
   CONTINUE BUTTON
   ============================================ */
.md-continue-section {
    display: none;
    padding: 20px 0 0;
    background: transparent;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

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

.md-continue-btn {
    width: 100%;
    max-width: 400px;
    padding: 20px 50px;
    background: rgba(255, 255, 255, 0.95);
    color: #4A90E2 !important;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.md-continue-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 1);
    color: #4A90E2 !important;
}

.md-continue-btn:active {
    transform: translateY(-1px);
}

/* ============================================
   BOOKING FORM SECTION
   ============================================ */
.md-booking-form-section {
    padding: 50px;
    background: #ffffff;
    display: none;
    border-radius: 0 0 20px 20px;
    animation: slideDown 0.5s ease-out;
}

.md-booking-form-section h4 {
    display: block;
    margin: 0 0 30px;
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
    text-align: center;
}

/* Selected Slot Info Box */
.selected-slot-info {
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f7ff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 35px;
    border-left: 5px solid #4A90E2;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.1);
}

.selected-slot-info p {
    margin: 10px 0;
    font-size: 16px;
    color: #2d3748;
    line-height: 1.6;
}

.selected-slot-info strong {
    color: #4A90E2;
    font-weight: 600;
    display: inline-block;
    min-width: 100px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #1d2327;
}

.form-group label .required {
    color: #e53e3e;
    margin-left: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1d2327;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    background: #f7faff;
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* Submit Button */
#md-booking-form button[type="submit"] {
    width: 100%;
    padding: 20px 40px;
    background: linear-gradient(135deg, #4A90E2 0%, #5BA3F5 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    margin-top: 10px;
}

#md-booking-form button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.4);
}

#md-booking-form button[type="submit"]:active {
    transform: translateY(-1px);
}

#md-booking-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   SUCCESS MESSAGE
   ============================================ */
.md-booking-success {
    padding: 60px 40px;
    text-align: center;
    background: #ffffff;
    border-radius: 20px;
    animation: fadeIn 0.5s ease-out;
}

.md-booking-success .success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.3);
}

.md-booking-success h3 {
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 20px;
}

.md-booking-success p {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 30px;
}

.md-booking-success .booking-details {
    background: #f7fafc;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: left;
}

.md-booking-success .booking-details p {
    margin: 12px 0;
    font-size: 16px;
}

.md-booking-success .booking-details strong {
    color: #2d3748;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

/* Calendar Download Buttons */
.calendar-options {
    margin: 40px 0;
}

.calendar-options h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.calendar-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.calendar-btn.google {
    background: #4285F4;
    color: #ffffff;
}

.calendar-btn.outlook {
    background: #0078D4;
    color: #ffffff;
}

.calendar-btn.apple {
    background: #000000;
    color: #ffffff;
}

.calendar-btn.ical {
    background: #6b7280;
    color: #ffffff;
}

.calendar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Success Actions */
.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.success-actions .btn {
    padding: 14px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.success-actions .btn-secondary {
    background: #4A90E2;
    color: #ffffff;
}

.success-actions .btn-outline {
    background: transparent;
    color: #4A90E2 !important;
    border: 2px solid #4A90E2;
}

.success-actions .btn-outline:hover {
    color: #ffffff !important;
    background: #4A90E2;
}

.success-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* ============================================
   ERROR/INFO MESSAGES
   ============================================ */
.md-booking-messages {
    position: fixed;
    top: 100px;
    right: 30px;
    max-width: 400px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.md-error-message,
.md-info-message {
    padding: 18px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.md-error-message {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #e53e3e;
}

.md-info-message {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #3182ce;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .md-time-slots-overlay {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin-top: 30px;
    }

    .md-calendar-wrapper {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .md-calendar-container {
        border-radius: 16px;
    }

    .md-calendar-wrapper {
        padding-bottom: 30px;
        min-height: auto;
    }

    .md-calendar-header {
        padding: 40px 20px 25px;
    }

    .md-calendar-header h3 {
        font-size: 32px;
    }

    .md-calendar-section {
        padding: 30px 25px;
    }

    .ui-datepicker-title {
        font-size: 24px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .time-slot {
        padding: 14px 16px;
        font-size: 15px;
    }

    .md-continue-btn {
        font-size: 18px;
        padding: 18px 40px;
    }

    .md-booking-form-section {
        padding: 40px 25px;
    }

    .md-booking-form-section h4 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .md-calendar-header {
        padding: 30px 15px 20px;
    }

    .md-calendar-header h3 {
        font-size: 26px;
    }

    .md-calendar-section {
        padding: 20px 15px;
    }

    .ui-datepicker-title {
        font-size: 20px;
    }

    .ui-datepicker-calendar tbody td a,
    .ui-datepicker-calendar tbody td span {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .ui-datepicker-calendar thead th {
        font-size: 14px;
        padding-bottom: 15px;
    }

    .md-calendar-wrapper {
        padding-bottom: 30px;
        min-height: auto;
    }

    .md-time-slots-overlay {
        padding: 20px 15px;
    }

    .time-slots-grid {
        gap: 8px;
    }

    .time-slot {
        padding: 12px 10px;
        font-size: 14px;
    }

    .md-continue-btn {
        font-size: 17px;
        padding: 16px 32px;
    }

    .md-booking-form-section {
        padding: 30px 20px;
    }

    .md-booking-form-section h4 {
        font-size: 22px;
    }

    .form-group input,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 15px;
    }

    #md-booking-form button[type="submit"] {
        font-size: 18px;
        padding: 18px 32px;
    }

    .md-booking-messages {
        right: 15px;
        left: 15px;
        max-width: calc(100% - 30px);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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