/* Universal Drawer Styles - Right Side Panel Replacement for Modals */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.drawer.active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

.drawer-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    font-size: 18px;
}

.drawer-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.drawer-body {
    flex: 1;
    padding: 24px;
    background: #f8fafc;
    overflow-y: auto;
    overflow-x: hidden;
}

.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

/* Large drawer variant */
.drawer.drawer-lg {
    max-width: 700px;
}

/* Small drawer variant */
.drawer.drawer-sm {
    max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .drawer {
        max-width: 100%;
    }
}

/* Drawer utility functions - to be included in pages */
.drawer-utils {
    display: none;
}

