/* Global Modal Styles - DO NOT SCOPE */

/* ============================================
   Full Screen Modal
   ============================================ */

.rf-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000;
    background: rgba(0,0,0,.08);
}

.rf-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    background: var(--rf-surface-0);
    display: flex;
    flex-direction: column;
}

.rf-modal-header {
    height: 56px;
    padding: 0 var(--rf-space-4);
    border-bottom: 1px solid var(--rf-border-color);
    background: var(--rf-surface-0);
    justify-content: space-between;
}

.rf-modal-title {
    flex: 1;
    text-align: right;
    font-weight: var(--rf-font-weight-bold);
    font-size: var(--rf-font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rf-modal-header-right {
    width: 40px;
}

.rf-modal-close {
    width: 40px;
    height: 40px;
    background-color: transparent;
    color: black;
    font-size: 20px;
}

.rf-modal-body {
    flex: 1;
    overflow: auto;
    background: var(--rf-surface-0);
    padding: var(--rf-space-4);
}

.rf-modal-footer {
    padding: var(--rf-space-4);
    background: var(--rf-surface-0);
}

@media (min-width: 768px) {
    .rf-modal-backdrop {
        background: rgba(0, 0, 0, 0.5);
        padding: 20px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .rf-modal {
        position: relative !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        max-width: 600px;
        max-height: 90vh;
        border-radius: var(--rf-radius-lg);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .rf-modal-backdrop {
        padding: 40px;
    }
}

/* ============================================
   Bottom Sheet Modal
   ============================================ */

.bottom-sheet-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    z-index: 1000;
    animation: fadeIn 0.2s ease-in-out;
}

.bottom-sheet-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--rf-color-neutral-200);
}

.bottom-sheet-title {
    font-family: Estedad, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--rf-color-neutral-900);
}

.bottom-sheet-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
}

.bottom-sheet-close:hover {
    background: var(--rf-color-neutral-50);
}

.bottom-sheet-close i {
    width: 20px;
    height: 20px;
    background-color: var(--rf-color-neutral-600);
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.bottom-sheet-footer {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--rf-color-neutral-200);
    background: white;
}

.bottom-sheet-footer > button,
.bottom-sheet-footer > .btn-reset,
.bottom-sheet-footer > .btn-apply {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-family: Estedad, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bottom-sheet-footer > .btn-reset {
    background: white;
    color: var(--rf-color-neutral-700);
    border: 1px solid var(--rf-color-neutral-200);
}

.bottom-sheet-footer > .btn-reset:hover {
    background: var(--rf-color-neutral-50);
    border-color: var(--rf-color-neutral-300);
}

.bottom-sheet-footer > .btn-reset:active {
    transform: scale(0.98);
}

.bottom-sheet-footer > .btn-apply {
    background: var(--rf-color-primary);
    color: white;
    border: none;
}

.bottom-sheet-footer > .btn-apply:hover {
    background: var(--rf-color-primary-dark);
}

.bottom-sheet-footer > .btn-apply:active {
    transform: scale(0.98);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
