/*
 * Bottom-sheet modal styles, duplicated from webapp/styles.css so the
 * landing page's login modal (see ../js/login.bundle.js, built from
 * ../../../loginModal.mjs via ui.mjs's renderModal) renders correctly
 * without pulling in the app's full stylesheet. Keep in sync by hand if
 * the source rules in webapp/styles.css change.
 */

:root {
    --color-primary-hover: #1651A3;
    --color-primary-rgb: 30, 102, 194;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.bottom-sheet-overlay.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet-content {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    z-index: 2001;
    color: #333;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

.bottom-sheet-overlay.show .bottom-sheet-content {
    transform: translateX(-50%) translateY(0);
}

.sheet-header-section {
    flex-shrink: 0;
    padding: 24px 16px 16px 16px;
    background-color: #ffffff;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.sheet-header-section .modal-title {
    flex: 1;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 20px;
    margin: 0;
}

.sheet-scroll-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 40px 16px;
    position: relative;
    overscroll-behavior-y: contain;
}

.sheet-handle-bar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
}

.sheet-back-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    margin-left: -8px;
    color: #333;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-button.cancel-button {
    background-color: #f0f2f5;
    border: none;
    color: #333;
}

.modal-button.cancel-button:hover {
    background-color: #e0e0e0;
}

.modal-button.add-button {
    background-color: #007bff;
    border: none;
    color: white;
}

.modal-button.add-button:hover {
    background-color: #0056b3;
}

@media (max-width: 600px) {
    .bottom-sheet-content {
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        bottom: 0;
    }

    .sheet-handle-bar {
        display: none;
    }

    .sheet-header-section {
        padding: 16px;
    }

    .sheet-back-btn {
        display: flex;
    }
}
