/* ============================================
   REMINDO — Component Styles
   Top bar, bottom nav, cards, buttons, forms,
   modals, drawers, toasts, badges, empty states
   ============================================ */

/* ===== TOP BAR ===== */
.top-bar {
    position: fixed;
    top: calc(var(--safe-top) + 16px);
    left: 16px;
    right: 16px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08); /* Modern glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 6px;
    z-index: var(--z-nav);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: background var(--transition-base);
}

.top-bar__left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.top-bar__back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.top-bar__back:active {
    background: var(--glass-bg);
    transform: scale(0.92);
}

.top-bar__title {
    font-size: 1.15rem;
    font-weight: var(--fw-bold);
    background: linear-gradient(135deg, #4A90E2, #9013FE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.top-bar__title--plain {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    font-size: var(--fs-md);
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.top-bar__profile {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.top-bar__profile:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.92);
}

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
    position: fixed;
    top: calc(var(--safe-top) + 16px + 48px + 8px);
    right: 16px;
    width: 250px;
    background: var(--dropdown-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-xs) 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    z-index: var(--z-toast);
    transform-origin: top right;
    animation: scaleIn 200ms var(--ease-out) forwards;
}

.profile-dropdown.hidden {
    display: none !important;
    animation: none;
}

.profile-dropdown__header {
    padding: var(--space-sm) var(--space-md);
}

.profile-dropdown__name {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--primary-light);
    margin-bottom: 2px;
}

.profile-dropdown__email {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.profile-dropdown__divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-xs) 0;
}

.profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.profile-dropdown__item:active {
    background: var(--surface-hover);
}

.profile-dropdown__item--danger {
    color: #ff6b6b;
}

.profile-dropdown__item svg {
    color: var(--text-secondary);
}

.profile-dropdown__item--danger svg {
    color: #ff6b6b;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 20px);
    left: 20px;
    right: 20px;
    height: 64px;
    background: rgba(255, 255, 255, 0.08); /* Stronger glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-nav);
    padding: 0 16px;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-medium);
    transition: all var(--transition-fast);
    position: relative;
}

.bottom-nav__item svg {
    transition: all var(--transition-fast);
}

.bottom-nav__item.active {
    color: var(--primary);
}

.bottom-nav__item.active svg {
    filter: drop-shadow(0 0 6px rgba(var(--primary-rgb), 0.4));
}

.bottom-nav__item:active {
    transform: scale(0.9);
}

/* ===== MAIN CONTENT ===== */
.section-header {
    display: none !important;
}

.main-content {
    flex: 1;
    margin-top: calc(16px + 48px); /* Accommodate floating top bar */
    margin-bottom: calc(var(--bottom-nav-height) + 40px); /* Accommodate floating nav pill */
    padding: var(--content-padding);
    padding-top: calc(var(--safe-top) + var(--space-xl));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: 100px;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: all var(--transition-spring);
    white-space: nowrap;
    border: none;
    outline: none;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.94);
}

.btn--primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
}

.btn--primary:active {
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);
}

.btn--accent {
    background: var(--accent);
    color: #0a0a0f;
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.3);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn--ghost:active { 
    border-color: var(--primary); 
    color: var(--text-primary); 
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.96);
}

.btn--danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 12px rgba(var(--danger-rgb), 0.25);
}
.btn--danger:active { 
    transform: scale(0.96); 
    background: #ff4d4d;
    box-shadow: 0 0 20px rgba(var(--danger-rgb), 0.5);
}

.btn--sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--fs-sm);
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-base);
    transition: all var(--transition-fast);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card--glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card--interactive {
    cursor: pointer;
}

.card--interactive:active {
    transform: scale(0.97);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: var(--space-base);
}

.form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-hint {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-2xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.form-actions .btn {
    flex: 1;
}

/* ===== CUSTOM SELECT BOX ===== */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-base);
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-base);
    cursor: pointer;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all var(--transition-fast);
    min-height: 46px;
}

.custom-select__trigger svg {
    transition: transform 300ms var(--ease-spring);
}

.custom-select__trigger:active, .custom-select.is-open .custom-select__trigger {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.custom-select.is-open .custom-select__trigger svg {
    transform: rotate(180deg);
}

.custom-select__options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-xs) 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    transform-origin: top;
    animation: scaleIn 200ms var(--ease-out) forwards;
}

.custom-select__option {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.custom-select__option:active, .custom-select__option.selected {
    background: var(--surface-hover);
    color: var(--primary-light);
}

/* ===== OVERLAY ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    transition: opacity var(--transition-normal);
}

/* ===== ABOUT MODAL ===== */
.about-link:active {
    background: var(--surface-hover) !important;
    transform: scale(0.98);
}

/* ===== MODAL (Bottom Sheet) ===== */
.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90dvh;
    background: rgba(var(--bg-rgb), 0.98);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    animation: slideUp 350ms var(--ease-out) forwards;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.modal.hidden {
    animation: none;
}

.modal__handle {
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: var(--space-md) auto var(--space-sm);
    flex-shrink: 0;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal__title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal__close:active {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.modal__content {
    padding: var(--space-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* ===== DRAWER (Sections Menu) ===== */
.drawer {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border);
    z-index: var(--z-drawer);
    padding: var(--space-md) var(--space-lg) var(--space-xl);
    animation: slideUp 300ms var(--ease-out) forwards;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8);
}

.drawer.hidden {
    animation: none;
}

.drawer__handle {
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 0 auto var(--space-base);
}

.drawer__title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drawer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--space-md);
}

.drawer__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xs);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    background: var(--glass-bg);
    border: 1px solid transparent;
}

.drawer__item:active {
    transform: scale(0.93);
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.drawer__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.drawer__label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    text-align: center;
}

/* ===== CONFIRM DIALOG ===== */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 48px));
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    z-index: var(--z-modal);
    text-align: center;
    animation: scaleInCentered 250ms var(--ease-spring) forwards;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.confirm-dialog__icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.confirm-dialog__title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-sm);
}

.confirm-dialog__text {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

.confirm-dialog__actions {
    display: flex;
    gap: var(--space-md);
}

.confirm-dialog__actions .btn {
    flex: 1;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: auto;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    width: min(320px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    transition: all 300ms var(--ease-out);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast__icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-weight: var(--fw-bold);
}

.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info .toast__icon { color: var(--primary); }

.toast__message {
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    color: var(--text-primary);
    flex: 1;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-lg));
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-primary), var(--shadow-md);
    z-index: var(--z-sticky);
    transition: all var(--transition-fast);
    animation: bounceIn 500ms var(--ease-out) forwards;
}

.fab:active {
    transform: scale(0.9);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge--primary { background: transparent; color: var(--primary-light); border: none; }
.badge--success { background: transparent; color: var(--success); border: none; }
.badge--warning { background: transparent; color: var(--warning); border: none; }
.badge--danger { background: transparent; color: var(--danger); border: none; }
.badge--accent { background: transparent; color: var(--accent); border: none; }

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--space-base);
    opacity: 0.7;
}

.empty-state__title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-xs);
}

.empty-state__text {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 260px;
}

/* ===== SECTION HEADER (used in section pages) ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-base);
}

.section-header__count {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    font-weight: var(--fw-medium);
}

/* ===== ITEM CARD (list items in sections) ===== */
.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-base);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
    position: relative;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.item-card:last-child {
    margin-bottom: 0;
}

.item-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.item-card__title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    flex: 1;
}

.item-card__subtitle {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.item-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-sm);
}

.item-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.item-card__meta-item svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.item-card__actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.item-card__action {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.item-card__action:active {
    color: var(--text-primary);
    background: var(--glass-bg);
    transform: scale(0.85);
}

.item-card__action--edit:active { color: var(--primary); }
.item-card__action--delete:active { color: var(--danger); }

.item-card__action svg {
    width: 16px;
    height: 16px;
}

/* Border accent variants */
.item-card--birthday { border-left: 3px solid #ff6b9d; }
.item-card--bills { border-left: 3px solid #ffb347; }
.item-card--student { border-left: 3px solid #4facfe; }
.item-card--jobs { border-left: 3px solid #7c5cfc; }
.item-card--medicines { border-left: 3px solid #00d4aa; }
.item-card--wishlist { border-left: 3px solid #f093fb; }
.item-card--reminder { border-left: 3px solid var(--warning); }

/* ===== STATUS INDICATORS ===== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    flex-shrink: 0;
}

.status-dot--active { background: var(--success); }
.status-dot--warning { background: var(--warning); }
.status-dot--danger { background: var(--danger); }
.status-dot--neutral { background: var(--text-tertiary); }

/* ===== TAGS ===== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-medium);
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.tag--high { background: transparent; color: var(--danger); border: none; }
.tag--medium { background: transparent; color: var(--warning); border: none; }
.tag--low { background: transparent; color: var(--success); border: none; }

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton--text {
    height: 14px;
    width: 100%;
    margin-bottom: var(--space-sm);
}

.skeleton--text:last-child {
    width: 60%;
}

.skeleton--box {
    height: 80px;
    border-radius: var(--radius-md);
}

/* ===== FLATPICKR CUSTOMIZATION ===== */
.flatpickr-calendar {
    background: var(--dropdown-bg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-md) !important;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-day:hover {
    background: var(--surface-hover) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
}

.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after, .flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after {
    display: none !important;
}

/* Flatpickr month dropdown must be visible and readable */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    display: inline-block !important;
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    color: var(--text-primary) !important;
    font-size: var(--fs-base) !important;
    font-weight: var(--fw-semibold) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--dropdown-bg);
    color: var(--text-primary);
}

.flatpickr-current-month .numInputWrapper input,
.flatpickr-current-month .numInputWrapper {
    color: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text-secondary) !important;
    fill: var(--text-secondary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--primary) !important;
    fill: var(--primary) !important;
}

.flatpickr-weekdays .flatpickr-weekday {
    color: var(--text-tertiary) !important;
    font-weight: var(--fw-medium) !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-tertiary) !important;
}

/* ===== DESKTOP RESPONSIVE MODALS & DRAWERS (>= 768px) ===== */
@media (min-width: 768px) {
    /* Transform bottom sheets into centered popup modals */
    .modal, .drawer {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: auto !important;
        width: 100% !important;
        max-width: 500px !important;
        height: max-content !important;
        max-height: 85vh !important;
        border-radius: var(--radius-xl) !important;
        animation: scaleIn 300ms var(--ease-out) forwards !important;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
        border: 1px solid var(--glass-border);
    }
    
    .modal.hidden, .drawer.hidden {
        animation: none !important;
    }

    /* Hide the drag handles since it's a popup now */
    .modal__handle, .drawer__handle {
        display: none !important;
    }

    /* Ensure custom select dropdowns don't overflow the modal */
    .custom-select__options {
        max-height: 280px;
    }
}
/* ===== SKELETON LOADERS ===== */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: var(--surface);
    border-radius: var(--radius-sm);
    color: transparent !important;
    min-height: 24px;
}
.skeleton * {
    visibility: hidden;
}

.skeleton::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.02) 20%,
        rgba(255, 255, 255, 0.05) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ===== EMPTY STATES ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    color: var(--text-secondary);
    min-height: 200px;
    animation: scaleIn var(--transition-base);
}

.empty-state__icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    opacity: 0.9;
    filter: drop-shadow(0 8px 24px rgba(var(--primary-rgb), 0.4));
}

.empty-state__title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.3px;
}

.empty-state__desc {
    font-size: var(--fs-sm);
    max-width: 260px;
    line-height: 1.5;
}

/* ===== FLOATING LABELS ===== */
.input-group.floating,
.form-group.floating {
    position: relative;
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column-reverse;
}

.input-group.floating .input,
.form-group.floating .form-input {
    padding-top: 24px;
    padding-bottom: 8px;
    min-height: 56px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group.floating label,
.form-group.floating label:not([style*="display:flex"]) {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: var(--fs-base);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    margin-bottom: 0;
}

.input-group.floating .input:focus + label,
.input-group.floating .input:not(:placeholder-shown) + label,
.form-group.floating .form-input:focus + label:not([style*="display:flex"]),
.form-group.floating .form-input:not(:placeholder-shown) + label:not([style*="display:flex"]) {
    top: 14px;
    font-size: 0.65rem;
    font-weight: var(--fw-bold);
    color: var(--primary-light);
    letter-spacing: 0.5px;
}

/* ===== QUICK ACTIONS (Long-Press Radial Menu) ===== */

/* Dark glass overlay on the card */
.quick-actions-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius-md);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    animation: qa-fade-in 0.2s ease-out;
}

@keyframes qa-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Each action button */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: qa-pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.quick-action-btn:nth-child(1) { animation-delay: 0.05s; }
.quick-action-btn:nth-child(2) { animation-delay: 0.1s; }
.quick-action-btn:nth-child(3) { animation-delay: 0.15s; }

@keyframes qa-pop-in {
    from { opacity: 0; transform: scale(0.3) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Circle icon container */
.quick-action-btn__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-action-btn__icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.quick-action-btn:active .quick-action-btn__icon {
    transform: scale(0.85);
}

/* Variant colors */
.quick-action-btn--done .quick-action-btn__icon {
    background: rgba(78, 205, 196, 0.9);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.35);
}
.quick-action-btn--duplicate .quick-action-btn__icon {
    background: rgba(0, 136, 255, 0.9);
    box-shadow: 0 4px 16px rgba(0, 136, 255, 0.35);
}
.quick-action-btn--delete .quick-action-btn__icon {
    background: rgba(255, 107, 107, 0.9);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}

/* Label text */
.quick-action-btn__label {
    font-size: 0.6rem;
    font-weight: var(--fw-semibold);
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Pulse ring animation while holding */
.item-card.long-pressing {
    animation: lp-pulse 0.5s ease-out;
}

@keyframes lp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4); }
    100% { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0); }
}

/* ===== GLOBAL SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 10, 12, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.search-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.search-overlay__header {
    padding: var(--safe-top) var(--space-md) var(--space-md) var(--space-md);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--surface-elevated);
    border-radius: var(--radius-full);
    padding: 0 var(--space-md);
    height: 48px;
    border: 1px solid var(--border);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-primary);
}

.search-bar svg {
    color: var(--text-secondary);
    margin-right: var(--space-sm);
}

.search-bar input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary);
    font-size: var(--fs-base);
    height: 100%;
    outline: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0;
}

.search-bar input:focus {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.search-bar input::placeholder {
    color: var(--text-tertiary);
}

.search-clear {
    padding: 4px;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    text-align: center;
}

.search-empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.search-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.search-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-item__icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
}

.search-item__content {
    flex: 1;
}

.search-item__title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-item__subtitle {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}
