/* Front Desk Layout Modal Styles */

/* Modal Overlay */
.frontdesk-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 250ms ease-in-out forwards;
}

.frontdesk-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Modal Container */
.frontdesk-modal-container {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 95vw;
    height: 85vh;
    max-width: 900px;
    max-height: 700px;
    animation: slideInRight 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 768px) {
    .frontdesk-modal-container {
        width: 90vw;
    }
}

@media (min-width: 1024px) {
    .frontdesk-modal-container {
        width: 800px;
    }
}

/* Header */
.frontdesk-modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.frontdesk-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--bs-text);
    display: flex;
    align-items: center;
    margin: 0;
}

.frontdesk-modal-icon {
    background: #27AE60;
    color: white;
    padding: 6px;
    border-radius: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.frontdesk-modal-close {
    color: #9ca3af;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.frontdesk-modal-close:hover {
    color: #4b5563;
    background: var(--bs-body-bg);
}

/* Mobile/Compact View */
.frontdesk-modal-mobile-view {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bs-body-bg);
    display: block;
}

@media (min-width: 768px) {
    .frontdesk-modal-mobile-view {
        display: none;
    }
}

/* Accordion Styles */
.frontdesk-accordion-section {
    margin-bottom: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

.frontdesk-accordion-header {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.frontdesk-accordion-header:hover {
    background: var(--bs-body-bg);
}

.frontdesk-accordion-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bs-text);
}

.frontdesk-accordion-chevron {
    transition: transform 0.2s;
    color: #6b7280;
}

.frontdesk-accordion-section.active .frontdesk-accordion-chevron {
    transform: rotate(90deg);
}

.frontdesk-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.frontdesk-accordion-section.active .frontdesk-accordion-content {
    max-height: 1000px;
    transition: max-height 0.3s ease-in;
}

.frontdesk-section-content {
    padding: 16px;
}

.frontdesk-section-placeholder {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Hide section header in mobile/accordion view */
.frontdesk-modal-mobile-view .frontdesk-section-header {
    display: none;
}

/* Layout Section Styles */
.frontdesk-layout-container {
    background-color: var(--bs-body-bg); /* gray-50 */
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--bs-border-color); /* gray-100 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    min-height: 119px;
}

.frontdesk-layout-divider {
    border-top: 1px solid var(--bs-border-color); /* gray-200 */
    margin-top: 20px;
    margin-bottom: 20px;
    height: 0;
    width: 100%;
}

/* Toggle Switch Styles */
.frontdesk-toggle-item {
    margin-bottom: 14px;
}

.frontdesk-toggle-item:last-child {
    margin-bottom: 0;
}

.frontdesk-toggle-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.frontdesk-toggle-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.frontdesk-toggle-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--bs-text);
    margin-bottom: 2px;
}

.frontdesk-toggle-description {
    display: block;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* label + description spacing */
#section-workflowRules .frontdesk-layout-container .opacity-60 label.block {
    margin-bottom: 2px !important;
}

/* #section-workflowRules .frontdesk-layout-container .opacity-60 p.text-xs {
    margin-top: 0;
} */

/* Auto-cancel No-shows SPACING Alert if Ticket Pending */
#section-workflowRules .frontdesk-layout-container .opacity-60 > div + div {
    margin-top: 14px;
}

/* spacing text vertically in WorkflowRules sec  */
#section-workflowRules .frontdesk-layout-container > .flex.items-start.mb-2\.5 {
    margin-bottom: 14px !important;
}


.frontdesk-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.frontdesk-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.frontdesk-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.frontdesk-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.frontdesk-toggle-switch input:checked + .frontdesk-toggle-slider {
    background-color: var(--bs-main);
}

.frontdesk-toggle-switch input:checked + .frontdesk-toggle-slider:before {
    transform: translateX(20px);
}

.frontdesk-toggle-switch input:disabled + .frontdesk-toggle-slider {
    background-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.frontdesk-toggle-switch input:disabled + .frontdesk-toggle-slider:before {
    background-color: var(--bs-body-bg);
}

/* Segmented Control Styles */
.frontdesk-segmented-control {
    display: flex;
    background-color: var(--bs-body-bg);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.frontdesk-segmented-control input[type="radio"] {
    display: none;
}

.frontdesk-segmented-option {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Segmented Control - Selected state using aria-selected */
.frontdesk-segmented-option[aria-selected="true"] {
    background-color: white;
    color: var(--bs-main);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Appointment Default State 
/* Fallback for checked input (if aria-selected not updated) */
.frontdesk-segmented-control input[type="radio"]:checked + .frontdesk-segmented-option {
    background-color: white;
    color: var(--bs-main);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Unselected state */
.frontdesk-segmented-option[aria-selected="false"] {
    background-color: transparent;
    color: #6b7280;
}

/* spacing for section titles in WorkflowRules */
#section-workflowRules .space-y-3 > h4 {
    margin-top: 0;
    margin-bottom: 2px !important;
}

#section-workflowRules .space-y-6 > .space-y-3:not(:first-child) {
    margin-top: 24px;
}

/* ticket sectionssections */
#section-ticketSection .space-y-3 > h4 {
    margin-top: 0;
    margin-bottom: 2px !important;
}

#section-ticketSection .space-y-6 > .space-y-3:not(:first-child) {
    margin-top: 24px;
}

#section-teamSection .space-y-3 > h4 {
    margin-top: 0;
    margin-bottom: 2px !important;
}

#section-teamSection .space-y-6 > .space-y-3:not(:first-child) {
    margin-top: 24px;
}
/* Desktop View */
.frontdesk-modal-desktop-view {
    flex: 1;
    overflow: hidden;
    display: none;
}

@media (min-width: 768px) {
    .frontdesk-modal-desktop-view {
        display: flex;
    }
}

.frontdesk-modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.frontdesk-modal-sidebar {
    width: 176px;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
}

.frontdesk-sidebar-nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.frontdesk-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--bs-text);
    gap: 8px;
}

.frontdesk-nav-item > span {
    flex: 1;
    text-align: center;
}

.frontdesk-nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--bs-text);
}

.frontdesk-nav-item.active {
    background: white;
    color: var(--bs-main);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bs-border-color);
}

.frontdesk-nav-item.active .frontdesk-nav-arrow {
    color: var(--bs-main);
}

.frontdesk-nav-arrow {
    opacity: 0;
    transition: opacity 0.2s;
}

.frontdesk-nav-item.active .frontdesk-nav-arrow {
    opacity: 1;
}

/* Content Area */
.frontdesk-modal-content {
    flex: 1;
    overflow-y: auto;
    background: white;
    height: 610px;
}

.frontdesk-content-wrapper {
    padding: 20px;
}

.frontdesk-section-panel {
    display: none;
}

.frontdesk-section-panel.active {
    display: block;
}

/* Footer */
.frontdesk-modal-footer {
    padding: 8px 20px;
    border-top: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.frontdesk-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.frontdesk-footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-footer-btn:hover {
    color: var(--bs-text);
    background: var(--bs-body-bg);
}

.frontdesk-unsaved-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #d97706;
    margin-left: 8px;
}

.frontdesk-unsaved-dot {
    width: 6px;
    height: 6px;
    background: var(--bs-accent);
    border-radius: 50%;
}

.frontdesk-footer-right {
    display: flex;
    gap: 12px;
}

.frontdesk-footer-btn-cancel {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-footer-btn-cancel:hover {
    color: #111827;
    background: #f3f4f6;
}

.frontdesk-footer-btn-save {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: var(--bs-main);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-footer-btn-save:hover {
    background: var(--bs-main-hover);
}

.frontdesk-footer-btn-save:disabled {
    background: var(--bs-body-bg);
    color: #9ca3af;
    cursor: not-allowed;
}

/* Confirmation Dialogs */
.frontdesk-confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 250ms ease-in-out forwards;
}

.frontdesk-confirm-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.frontdesk-confirm-content {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 24px;
    max-width: 448px;
    width: calc(100% - 32px);
    margin: 0 16px;
    animation: slideIn 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.frontdesk-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 8px 0;
}

.frontdesk-confirm-message {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 24px 0;
}

.frontdesk-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.frontdesk-confirm-btn-cancel {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-confirm-btn-cancel:hover {
    background: #f3f4f6;
}

.frontdesk-confirm-btn-confirm {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: var(--bs-main);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-confirm-btn-confirm:hover {
    background: var(--bs-main-hover);
}

.frontdesk-confirm-btn-reset {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.frontdesk-confirm-btn-reset:hover {
    background: #dc2626;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styles */
.frontdesk-modal-sidebar::-webkit-scrollbar,
.frontdesk-modal-content::-webkit-scrollbar,
.frontdesk-modal-mobile-view::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.frontdesk-modal-sidebar::-webkit-scrollbar-track,
.frontdesk-modal-content::-webkit-scrollbar-track,
.frontdesk-modal-mobile-view::-webkit-scrollbar-track {
    background: transparent;
}

.frontdesk-modal-sidebar::-webkit-scrollbar-thumb,
.frontdesk-modal-content::-webkit-scrollbar-thumb,
.frontdesk-modal-mobile-view::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.frontdesk-modal-sidebar::-webkit-scrollbar-thumb:hover,
.frontdesk-modal-content::-webkit-scrollbar-thumb:hover,
.frontdesk-modal-mobile-view::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Custom spacing for Layout Section */
.frontdesk-layout-container .space-y-3 > * + * {
    margin-top: 12px !important;
}

.frontdesk-layout-container label.block {
    margin-bottom: 16px !important;
}

.frontdesk-layout-container .pb-1 {
    padding-bottom: 8px !important;
}

/* layout section icon */
.frontdesk-section-header svg {
    stroke: #27AE60 !important;
    background-color: rgba(39, 174, 96, 0.1);
    /* border-radius: 40%; */
    padding: 8px;
    width: 34px !important;
    height: 34px !important;
}

/* custom inp  */
#customWidthPercentage {
    border: none !important;
    background-color: var(--bs-body-bg) !important;
    box-shadow: none !important;
}

#customWidthPercentage:disabled {
    background-color: #e5e7eb !important;
}

#autoNoShowTime {
    border: none !important;
    background-color: var(--bs-body-bg) !important;
    box-shadow: none !important;
}

#autoNoShowTime:disabled {
    background-color: #e5e7eb !important;
}

#pendingAlertMinutes {
    border: none !important;
    background-color: var(--bs-body-bg) !important;
    box-shadow: none !important;
}

#pendingAlertMinutes:disabled {
    background-color: #e5e7eb !important;
}

/* bg color Operation Templates - override utilities.scss */
.frontdesk-layout-container .bg-\[#E8F2FF\],
.frontdesk-layout-container div[class*="bg-[#E8F2FF]"] {
    background-color: #E8F2FF !important;
}

.frontdesk-layout-container .bg-\[#FFF8E6\],
.frontdesk-layout-container div[class*="bg-[#FFF8E6]"] {
    background-color: #FFF8E6 !important;
}