/* Base style */
.form-control {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background-color: #fff;
    color: #0f172a;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    /* removes native arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-position: right 0.6rem center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    padding-right: 2rem;
    /* room for arrow */
    line-height: 1.4;
    cursor: pointer;
}

/* Light mode arrow */
.light select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2367748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E<path d='M6 9l6 6 6-6'/></svg>");
}

/* Dark mode variant */
.dark .form-control {
    border-color: #334155;
    background-color: #0f172a;
    color: #e2e8f0;

    /* arrow with light stroke for contrast */
}

/* Optional: dropdown list background too */
.dark select.form-control option {
    background-color: #0f172a;
    color: #e2e8f0;
}

.bmiselect {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E<path d='M6 9l6 6 6-6'/></svg>");
}

/* Optional: brand color if you don’t have one in Tailwind config */
.text-brand {
    color: #2563eb;
}

.bg-brand {
    background-color: #2563eb;
}

/* Smooth transforms look better with this easing */
#calcPanel {
    transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tab {
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.tab.active {
    background: #f1f5f9;
    border-color: #cbd5e1;
    font-weight: 600;
}

.dark .tab.active {
    background: #1e293b;
    border-color: #334155;
}

.form-control {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
}

.form-control:focus {
    border-color: #2563eb;
    /* ring:2px; */
}

.dark .form-control {
    border-color: #334155;
    color: #e2e8f0;
}

html.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
}

.modal.is-open {
    display: block;
    z-index: 60;
}

/* base */
.modal[data-level="2"] {
    z-index: 70;
}

/* stacked */
.modal[data-level="3"] {
    z-index: 80;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.is-open .modal__backdrop {
    opacity: 1;
}

.modal__panel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal__card {
    margin-top: 2.5rem;
    /* sm:mt-0 if you want */
    width: min(960px, 95vw);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.dark .modal__card {
    background: rgba(2, 6, 23, 0.9);
}

.modal.is-open .modal__card {
    opacity: 1;
    transform: none;
}

#popupMortgageCalculator {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent background */
    backdrop-filter: blur(5px);
    /* Optional: Apply blur effect */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal content */
.popup-content {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 95vw;
    /* Ensure the modal does not exceed the screen width */
    max-height: 80vh;
    /* Limit the height to 80% of the screen */
    overflow-y: auto;
    /* Make content scrollable */
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
    /* Optional: Add shadow for a floating effect */
}

/* Optional: Smooth scrolling */
.popup-content {
    scroll-behavior: smooth;
}

/* Modal Close Button */
.close-popup {
    font-size: 24px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.close-popup:hover {
    color: #000;
}

/* Ensure the modal is hidden by default */
#popupMortgageCalculator {
    display: none;
    /* Make sure the modal is hidden initially */
}

/* Show modal when 'hidden' class is removed */
#popupMortgageCalculator:not(.hidden) {
    display: flex;
}

table {
    width: 100%;
}

tr,
td,
th {
    text-align: center !important;
}

/* ---------- Skin (Light) ---------- */
.scroll-skin {
    --scroll-thumb: rgba(100, 116, 139, 0.6);
    /* slate-500/60 */
    --scroll-thumb-hover: rgba(71, 85, 105, 0.8);
    /* slate-600/80 */
    --scroll-track: rgba(241, 245, 249, 0.9);
    /* slate-100/90 */
}

/* ---------- Skin (Dark) ---------- */
.dark .scroll-skin {
    --scroll-thumb: rgba(148, 163, 184, 0.5);
    /* slate-400/50 */
    --scroll-thumb-hover: rgba(203, 213, 225, 0.6);
    /* slate-300/60 */
    --scroll-track: rgba(17, 24, 39, 0.85);
    /* gray-900/85 */
}

/* Apply on any scrollable element (y/x/auto) */
.scroll-area {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    scrollbar-gutter: stable both-edges;
}

/* ---------- WebKit/Chromium ---------- */
.scroll-area::-webkit-scrollbar {
    width: 10px;
    /* vertical */
    height: 10px;
    /* horizontal */
}

.scroll-area::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-radius: 9999px;
}

.scroll-area::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb);
    border-radius: 9999px;
    border: 2px solid transparent;
    /* thinner look */
    background-clip: content-box;
}

.scroll-area:hover::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb-hover);
}

/* Optional: only-horizontal areas (tables, carousels) */
.scroll-area-x {
    overflow-x: auto;
    overflow-y: hidden;
}

.scroll-area-y {
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-content {
    display: none;
}

.show {
    display: block;
}

#categories-menu {
    z-index: 50 !important;
    background-color: white;
    color: black;
    transition: all 0.2s ease-in-out;
}

#categories-btn.active #caret-icon {
    transform: rotate(180deg);
}

.num {
    font-variant-numeric: tabular-nums;
}
