/* ------------------------------------ */
/* ------ General Modal Styling ------- */
/* ------------------------------------ */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #FFFABF;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* soft but noticeable */
    max-width: 440px;
    width: calc(85% - 2rem);
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: visible !important;
    /* Add these properties to your existing modal-content styles */
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    background: #333;
    color: #fff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/*
.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
}*/

.modal-buttons {
    display: flex;
    justify-content: center; /* Default for one item */
    width: 100%;
    margin-top: 1rem;
}

.modal-buttons:has(button:nth-child(2)) {
    justify-content: space-between; /* If two or more items */
}

.modal-link-list {
    text-align: center;
    margin-bottom: 1rem;
}

/* --------------------------------- */
/* ------ FlatPickr styling -------- */
/* --------------------------------- */

/* Flatpickr fixes for budget modal
#shared-modal .flatpickr-calendar {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
}*/

/* Global flatpickr overrides */
.flatpickr-calendar {
    z-index: 9999 !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    font-family: "itc-american-typewriter", serif !important;
    overflow: hidden !important;
    visibility: visible !important;
    animation: none !important; /* Disable animation to prevent jumping */
    transition: none !important; /* Disable transitions */
    inset: auto !important; /* Override any automatic positioning */
}

.flatpickr-wrapper {
    width: 100%;
}

/* Ensure the calendar doesn't override our positioning */
.flatpickr-calendar.open {
    display: block;
    z-index: 99999 !important;
}

/* Header */
.flatpickr-months .flatpickr-month {
    background: #333 !important;
    color: #fff !important;
    padding: 8px 0 !important;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* Header Text */
.flatpickr-current-month {
    color: #fff !important;
}

.flatpickr-current-month input.cur-year {
    color: #fff !important;
}

/* Weekdays */
.flatpickr-weekdays {
    background: #EDE9B6 !important;
}

.flatpickr-weekday {
    color: #333 !important;
    font-weight: bold !important;
}

/* Days */
.flatpickr-day {
    border-radius: 8px !important;
}

.flatpickr-day:hover {
    background: #F3E9FA !important;
}

.flatpickr-day.today {
    background: #F0F0F0 !important;
    border: 1px solid #8220D6 !important;
}

.flatpickr-day.selected {
    background: #8220D6 !important;
    color: #fff !important;
}

/* Arrows */
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    stroke: #fff !important;
    fill: none !important;
    width: 16px;
    height: 16px;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -------------------------------- */
/* ------ Input Dollar Sign ------- */
/* -------------------------------- */

.input-with-prefix {
    position: relative;
    /*display: flex; */
    align-items: center;
}

.input-with-prefix .prefix {
    position: absolute;
    left: 20px;
    top: 25%;
    pointer-events: none;
    font: normal 500 1.5rem/1.15 "itc-american-typewriter", serif;
    color: #333;
    vertical-align: super;
}

.input-with-prefix .prefix:focus {
    font-weight: 700;
    color: #8220D6;
}

.input-with-prefix input {
    padding-left: 20px; /* enough room for the $ */
}






.modal-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.modal-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.modal input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}


.delete-confirmation {
    margin: 15px 0;
    padding: 15px;
    background-color: rgba(217, 59, 22, 0.1); /* Light version of #D93B16 */
    border: 1px solid #D93B16;
    border-radius: 8px;
    text-align: center;
}

.delete-confirmation p {
    margin: 0 0 15px 0;
    font-weight: bold;
    color: #D93B16; /* The alert red as specified */
    text-align: center;
    font-size: 1.1rem;
}

.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.confirmation-buttons button {
    min-width: 80px;
}

.confirm-delete {
    background-color: #D93B16; /* Match the app's alert red */
    color: white;
}

.confirm-delete:hover {
    background-color: #B33110; /* Slightly darker on hover */
}