/**
 * MUDcal Admin Base Styles
 * Layout, utilities, modals, status badges
 */

/* Base Container */
.mudcal-admin-calendar {
    padding: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* Tools Bar */
.mudcal-admin-tools-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* Navigation Container */
.mudcal-responsive-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: space-between;
    max-width: 100%;
}

.mudcal-prev-range,
.mudcal-prev-day {
    order: 1;
}

.mudcal-next-range,
.mudcal-next-day {
    order: 2;
}

.mudcal-current-range-title,
.mudcal-current-day-title {
    order: 3;
    flex: 1;
    text-align: center;
}

/* Date Range Selector */
.mudcal-date-range-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    flex-wrap: nowrap;
    order: 4;
}

.mudcal-date-range-selector label {
    font-weight: 400;
    font-size: 13px;
    color: #50575e;
    margin: 0;
}

.mudcal-date-label-single {
    display: none;
}

.mudcal-date-input {
    height: 30px;
    padding: 3px 6px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 140px;
}

.mudcal-load-range-btn {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1.6;
}

/* Modal Overlay */
.mudcal-modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 100000 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

/* Force flex when opened via JavaScript */
.mudcal-modal-overlay[style*="display: flex"],
.mudcal-modal-overlay[style*="display:flex"],
.mudcal-modal-overlay[style*="display: block"],
.mudcal-modal-overlay[style*="display:block"],
.mudcal-modal-overlay.mudcal-modal-open {
    display: flex !important;
}

.mudcal-modal-dialog {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    max-width: 800px;
}

.mudcal-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mudcal-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.mudcal-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.mudcal-modal-close:hover {
    color: #000;
}

.mudcal-modal-body {
    padding: 20px;
}

.mudcal-modal-body hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #ddd;
}

.mudcal-modal-body h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.mudcal-modal-footer .button {
    min-height: 40px !important;
    padding: 10px 24px !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    height: auto !important;
    width: auto !important;
    box-sizing: border-box !important;
}

/* Status Badges */
.mudcal-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.mudcal-status-confirmed, .mudcal-status-active {
    background: #d4edda;
    color: #155724;
}

.mudcal-status-pending {
    background: #fff3cd;
    color: #856404;
}

.mudcal-status-cancelled, .mudcal-status-expired {
    background: #f8d7da;
    color: #721c24;
}

.mudcal-status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.mudcal-status-manual {
    background: #e2e3e5;
    color: #383d41;
}

/* Note indicator badge */
.mudcal-has-note-badge {
    display: inline-block;
    padding: 3px 8px;
    margin-left: 6px;
    border-radius: 3px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

.mudcal-has-note-badge::before {
    content: "\270F";
    margin-right: 3px;
}

/* Row border for bookings with notes */
.mudcal-booking-has-note {
    border-left: 3px solid #f59e0b !important;
}

/* Reschedule Modal Admin */
.mudcal-reschedule-info-admin {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.mudcal-reschedule-section-admin {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
}

.mudcal-reschedule-section-admin.mudcal-reschedule-new-admin {
    background: #e7f5ff;
    border-left-color: #00a32a;
}

.mudcal-reschedule-icon-admin {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mudcal-reschedule-icon-admin .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #2271b1;
}

.mudcal-reschedule-new-admin .mudcal-reschedule-icon-admin .dashicons {
    color: #00a32a;
}

.mudcal-reschedule-content-admin {
    flex: 1;
}

.mudcal-reschedule-label-admin {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.mudcal-reschedule-value-admin {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.mudcal-reschedule-select-admin {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.mudcal-reschedule-select-admin:focus {
    outline: none;
    border-color: #00a32a;
    box-shadow: 0 0 0 3px rgba(0, 163, 42, 0.1);
}

.mudcal-reschedule-arrow-admin {
    text-align: center;
    margin: -10px 0;
}

.mudcal-reschedule-arrow-admin .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2271b1;
}

.mudcal-modal-footer-admin {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.mudcal-modal-footer-admin.mudcal-modal-footer-stacked {
    flex-direction: column;
}

.mudcal-modal-footer-admin.mudcal-modal-footer-stacked .button {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 16px;
}

.mudcal-modal-footer-admin .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Alerts */
.mudcal-alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.mudcal-alert strong {
    font-weight: 600;
}

.mudcal-alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.mudcal-alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.mudcal-alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.mudcal-alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Loading State */
.mudcal-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

.mudcal-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: mudcal-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes mudcal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icon Buttons */
.mudcal-booking-actions .button .dashicons,
.mudcal-modal-body .button-small .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
    margin: 0;
}

.mudcal-booking-actions .button,
.mudcal-modal-body .button-small {
    padding: 4px 8px;
    min-width: 32px;
    text-align: center;
}
