/* =============================================
   BYL DRAWER — Save/Share Panel Component
   Add to your main stylesheet or base.html <style>
   ============================================= */

.byl-drawer-overlay {
    position: fixed; inset: 0; z-index: 1055;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 220ms ease;
}
.byl-drawer-overlay.byl-open {
    opacity: 1; pointer-events: all;
}

.byl-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: clamp(300px, 28vw, 460px);
    background: #ffffff;
    box-shadow: -4px 0 32px rgba(0, 51, 102, 0.12);
    transform: translateX(110%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1056;
    display: flex;
    flex-direction: column;
    border-radius: 12px 0 0 12px;
}
.byl-drawer.byl-open {
    transform: translateX(0);
}

/* Mobile — becomes a bottom sheet */
@media (max-width: 768px) {
    .byl-drawer {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%;
        max-height: 88dvh;
        border-radius: 16px 16px 0 0;
        transform: translateY(110%);
    }
    .byl-drawer.byl-open {
        transform: translateY(0);
    }
    .byl-drawer-handle {
        display: block;
        width: 36px; height: 4px;
        background: #dee2e6;
        border-radius: 99px;
        margin: 10px auto 4px;
        flex-shrink: 0;
    }
}
@media (min-width: 769px) {
    .byl-drawer-handle { display: none; }
}

/* Header */
.byl-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
.byl-drawer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #003366;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}
.byl-drawer-title i {
    color: #003366;
    font-size: 1rem;
}
.byl-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1rem;
    padding: 5px 7px;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: background 150ms, color 150ms;
}
.byl-drawer-close:hover {
    background: #f0f4f8;
    color: #003366;
}

/* Body / fields */
.byl-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.byl-drawer-body::-webkit-scrollbar { width: 5px; }
.byl-drawer-body::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.byl-drawer-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.byl-drawer-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: 0.01em;
}
.byl-drawer-label .byl-required {
    color: #dc3545;
    margin-left: 2px;
}

.byl-drawer-input,
.byl-drawer-textarea,
.byl-drawer-select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #cdd6e0;
    border-radius: 7px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    color: #1a1a2e;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 150ms, box-shadow 150ms;
}
.byl-drawer-input:focus,
.byl-drawer-textarea:focus,
.byl-drawer-select:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}
.byl-drawer-input.byl-error,
.byl-drawer-textarea.byl-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}
.byl-drawer-textarea {
    resize: vertical;
    min-height: 80px;
}

.byl-drawer-hint {
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.4;
}
.byl-drawer-error-msg {
    font-size: 0.72rem;
    color: #dc3545;
    display: none;
}

/* Footer */
.byl-drawer-footer {
    padding: 0.85rem 1.25rem 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}
.byl-drawer-footer .byl-btn-cancel {
    background: none;
    border: 1px solid #cdd6e0;
    color: #6c757d;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms, border-color 150ms, color 150ms;
}
.byl-drawer-footer .byl-btn-cancel:hover {
    background: #f0f4f8;
    border-color: #adb5bd;
    color: #1a1a2e;
}
.byl-drawer-footer .byl-btn-submit {
    background: #4CAF50; 
    border: 1px solid #4CAF50;
    color: #ffffff;
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 150ms, border-color 150ms;
}
.byl-drawer-footer .byl-btn-submit:hover {
    background: #4CAF50;
    border-color: #4CAF50;
}
.byl-drawer-footer .byl-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* =============================================
   END BYL DRAWER CSS
   ============================================= */