/* ==========================================================================
   Slide Panel System
   ========================================================================== */

/* Hide chat widget when panels are open */
body.slide-panel-open #fd-chat-client-v2 {
    display: none !important;
}

/* Backdrop — dims the main page when any panel is open */
.slide-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2100;
    opacity: 0;
    transition: opacity 150ms ease;
}

.slide-panel-backdrop--visible {
    opacity: 1;
}

/* Stack container — holds all panels */
.slide-panel-stack {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2110;
    pointer-events: none;
}

/* Individual panel wrapper — positioned and animated */
.slide-panel-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(0);
    transition: transform 300ms ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.slide-panel-wrapper--entering {
    transform: translateX(100%);
}

.slide-panel-wrapper--leaving {
    transform: translateX(100%);
    transition: transform 200ms ease-in;
}

/* Panel sizes */
.slide-panel-wrapper--sm {
    width: 400px;
}

.slide-panel-wrapper--md {
    width: 600px;
}

.slide-panel-wrapper--lg {
    width: 900px;
}

.slide-panel-wrapper--xl {
    width: 1200px;
}

/* Responsive — panels should not exceed viewport width */
@media (max-width: 400px) {
    .slide-panel-wrapper--sm { width: 100vw; }
}
@media (max-width: 600px) {
    .slide-panel-wrapper--md { width: 100vw; }
}
@media (max-width: 900px) {
    .slide-panel-wrapper--lg { width: 100vw; }
}
@media (max-width: 1200px) {
    .slide-panel-wrapper--xl { width: 100vw; }
}

/* Scrim overlay on non-front panels */
.slide-panel-scrim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
    display: none;
    pointer-events: auto;
}

/* Panel content container — fills wrapper, establishes flex column */
.slide-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ==========================================================================
   Panel Template Classes (used in panel HTML templates)
   ========================================================================== */

/* The directive element needs to fill the flex container */
slide-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

/* The root element inside each panel template */
.slide-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header — fixed top, title left, close button right */
.slide-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    min-height: 52px;
    border-bottom: 1px solid #e7eaec;
    flex-shrink: 0;
}

.slide-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.slide-panel-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 150ms ease;
}

.slide-panel-close:hover {
    color: #333;
}

/* Body — scrollable content area */
.slide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Footer — fixed bottom, right-aligned buttons */
.slide-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 15px;
    border-top: 1px solid #e7eaec;
    flex-shrink: 0;
}

/* Keyboard shortcut hint — left side of footer */
.slide-panel-shortcut-hint {
    margin-right: auto;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 300ms ease;
}

.slide-panel-shortcut-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
    line-height: 1.4;
}

.slide-panel-shortcut-hint--flash {
    color: #1ab394;
}

.slide-panel-shortcut-hint--flash kbd {
    color: #1ab394;
    border-color: #1ab394;
}
