/* ==========================================
   Dashboard Styles
   ========================================== */

/* ===================
   Base / Global
   =================== */

/* Modal open state - prevents body scrolling */
body.modal-open {
    overflow: hidden !important;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    /* Prevent native browser pull-to-refresh — we render our own. */
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

#app,
header,
#mobile-bottom-nav {
    max-width: 100vw;
    overflow-x: clip;
}

@supports not (overflow: clip) {
    #app,
    header,
    #mobile-bottom-nav {
        overflow-x: hidden;
    }
}

/* Ensure solid backgrounds - remove any patterns */
html, body, #app {
    background-image: none !important;
}


/* Default Lucide icon size */
[data-lucide] {
    width: 20px;
    height: 20px;
}

/* Theme transition */
html {
    transition: background-color 0.2s ease;
}

/* Dark mode palette: keep the existing indigo accent, replace the gray scale. */
:root.dark,
:root.dark body,
:root.dark #app {
    background-color: #11141c !important;
    color: #b9bfce;
}

:root.dark .hero-gradient {
    background: #11141c !important;
}

:root.dark .dashboard-card,
:root.dark #sidebar,
:root.dark .modal-content,
:root.dark .toast-content,
:root.dark .portfolio-dropdown,
:root.dark #portfolio-settings-popover > div,
:root.dark #transaction-settings-popover > div,
:root.dark #portfolios-search-popover > div,
:root.dark #transactions-search-popover > div,
:root.dark .dark\:bg-gray-800 {
    background-color: #161a26 !important;
}

:root.dark .dark\:bg-gray-900 {
    background-color: #11141c !important;
}

:root.dark .dark\:bg-gray-700,
:root.dark .dark\:bg-gray-700\/30,
:root.dark .dark\:bg-gray-700\/50,
:root.dark .dark\:bg-gray-700\/70 {
    background-color: #1c2130 !important;
}

:root.dark .dark\:bg-gray-800\/40,
:root.dark .dark\:bg-gray-800\/50 {
    background-color: rgb(22 26 38 / 0.74) !important;
}

:root.dark .dark\:bg-gray-600 {
    background-color: #262d40 !important;
}

/* Toggle ON state: keep the indigo track color in dark mode. The dark gray-600
   override above wins over Tailwind's `peer-checked:bg-[#6366f1]` because of
   !important, so we re-assert indigo with a more specific selector. */
:root.dark .peer:checked ~ .peer-checked\:bg-\[\#6366f1\] {
    background-color: #6366f1 !important;
}

:root.dark .dark\:bg-gray-100 {
    background-color: #d6d9e5 !important;
}

:root.dark .dark\:bg-\[rgba\(17\,24\,39\,0\.7\)\],
:root.dark .dark\:hover\:bg-\[rgba\(17\,24\,39\,0\.7\)\]:hover,
:root.dark .dark\:hover\:bg-\[rgba\(17\,24\,39\,0\.7\)\]\/50:hover,
:root.dark .dark\:hover\:bg-gray-700:hover,
:root.dark .dark\:hover\:bg-gray-700\/50:hover,
:root.dark .dark\:hover\:bg-gray-500:hover,
:root.dark .dark\:hover\:bg-gray-600:hover {
    background-color: #212737 !important;
}

:root.dark .dark\:border-gray-800,
:root.dark .dark\:border-gray-700,
:root.dark .dark\:border-gray-700\/50,
:root.dark .dark\:border-gray-600,
:root.dark .dark\:stroke-gray-700,
:root.dark #sidebar,
:root.dark .dashboard-card,
:root.dark .modal-content,
:root.dark .portfolio-dropdown,
:root.dark #portfolio-settings-popover > div,
:root.dark #transaction-settings-popover > div,
:root.dark #portfolios-search-popover > div,
:root.dark #transactions-search-popover > div {
    border-color: #232a3c !important;
}

:root.dark .dark\:stroke-gray-700 {
    stroke: #232a3c !important;
}

:root.dark .dark\:text-gray-100,
:root.dark .dark\:text-gray-200 {
    color: #d6d9e5 !important;
}

:root.dark .dark\:text-gray-300 {
    color: #b9bfce !important;
}

:root.dark .dark\:text-gray-400 {
    color: #969dad !important;
}

:root.dark .dark\:text-gray-500 {
    color: #737b91 !important;
}

:root.dark .dark\:text-gray-600 {
    color: #5f687d !important;
}

:root.dark .dark\:text-gray-900 {
    color: #11141c !important;
}

:root.dark .dark\:placeholder-gray-400::placeholder {
    color: #737b91 !important;
}

:root.dark input,
:root.dark select,
:root.dark textarea,
:root.dark .native-select-field__native,
:root.dark .field-mapping-select {
    background-color: #151a27 !important;
    border-color: #30374c !important;
    color: #d6d9e5 !important;
}

:root.dark .skeleton,
:root.dark .crypto-icon-placeholder {
    background: linear-gradient(90deg, #222839 25%, #30374c 50%, #222839 75%);
    background-size: 200% 100%;
}

/* Custom green background for P/L badges - only in light mode */
:root:not(.dark) .bg-green-50 {
    background-color: rgb(209 243 220 / 70%) !important;
}

/* ===================
   Components
   =================== */

/* Card styles - no hover effects */
.dashboard-card {
    transition: none;
}

/* Button transitions */
.theme-btn {
    transition: all 0.2s ease;
}

/* Progress bar animations */
.progress-bar {
    transition: width 0.5s ease-out;
}

/* Calendar tooltip */
.tooltip {
    display: none;
}

.calendar-day[data-highlighted]:hover .tooltip {
    display: block;
}

#list-transactions-btn:focus > span,
#list-transactions-btn:focus-visible > span,
#list-transactions-btn:active > span {
    opacity: 0 !important;
}

/* Calendar navigation */
.calendar-nav {
    transition: background-color 0.2s ease;
}

/* Donut chart center text */
.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#portfolio-value-display > .mt-2 {
    margin-top: 0.35rem;
}

#portfolio-total-value {
    line-height: 1;
}

/* Donut chart segment hover effect */
.donut-segment {
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.donut-segment:hover {
    opacity: 0.75;
}

/* Loading dots animation */
.loading-dots {
    display: inline-block;
    min-width: 24px;
}

.loading-dots::after {
    content: '•';
    animation: loadingDots 1s infinite;
    letter-spacing: 2px;
}

@keyframes loadingDots {
    0%, 20% { content: '•'; }
    40% { content: '••'; }
    60%, 100% { content: '•••'; }
}

/* Crypto icon placeholder styling */
.crypto-icon-placeholder {
    display: inline-block;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 50%;
}

.dark .crypto-icon-placeholder {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* No text wrapping for crypto values and tickers */
.transaction-item span,
.transaction-list-item span,
.crypto-value,
.price-value,
.list-price-value {
    white-space: nowrap;
}

.transaction-tile--closed {
    opacity: 0.5;
}

.transaction-tile--closed:hover {
    opacity: 0.5;
}

.transaction-tile--closed .transaction-side-amount {
    color: rgb(107 114 128) !important;
}

.transaction-tile--closed .transaction-side-price {
    color: rgb(156 163 175) !important;
}

.dark .transaction-tile--closed .transaction-side-amount,
.dark .transaction-tile--closed .transaction-side-price {
    color: #969dad !important;
}

/* Shared dashboard P/L inline treatment */
.pl-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1;
    white-space: nowrap;
}

.pl-label,
.pl-amount,
.pl-percent-pill {
    color: inherit;
    white-space: nowrap;
    line-height: 1;
    font-size: 0.68rem;
}

.pl-label {
    display: inline-block;
    font-weight: 400;
}

.pl-amount {
    display: inline-block;
    font-weight: 700;
}

.pl-percent-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 400;
}

.pl-status-text {
    display: inline-block;
    font-weight: 400;
    color: inherit;
    white-space: nowrap;
    line-height: 1;
    font-size: 0.68rem;
}

.pl-inline.pl-positive {
    color: #166534;
}

.pl-inline.pl-positive .pl-percent-pill {
    background: rgba(220, 252, 231, 0.82);
    border-color: rgba(167, 243, 208, 0.9);
}

.dark .pl-inline.pl-positive {
    color: #86efac;
}

.dark .pl-inline.pl-positive .pl-percent-pill {
    background: rgba(20, 83, 45, 0.24);
    border-color: rgba(22, 163, 74, 0.28);
}

.pl-inline.pl-negative {
    color: #b91c1c;
}

.pl-inline.pl-negative .pl-percent-pill {
    background: rgba(254, 242, 242, 0.88);
    border-color: rgba(254, 202, 202, 0.88);
}

.dark .pl-inline.pl-negative {
    color: #fca5a5;
}

.dark .pl-inline.pl-negative .pl-percent-pill {
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.28);
}

.pl-inline.pl-neutral {
    color: #6b7280;
}

.pl-inline.pl-neutral .pl-percent-pill {
    background: rgba(243, 244, 246, 0.9);
    border-color: rgba(229, 231, 235, 0.92);
}

.dark .pl-inline.pl-neutral {
    color: #d1d5db;
}

.dark .pl-inline.pl-neutral .pl-percent-pill {
    background: rgba(55, 65, 81, 0.42);
    border-color: rgba(107, 114, 128, 0.42);
}

.pl-inline.pl-locked {
    opacity: 0.48;
}

.portfolio-tile .portfolio-total {
    font-size: 1.15em;
}

.transaction-item .price-value {
    font-size: 0.8625rem;
    line-height: 1.15rem;
}

.portfolio-tile .portfolio-pl .pl-inline,
.portfolio-tile .portfolio-pl .pl-amount,
.portfolio-tile .portfolio-pl .pl-percent-pill,
#portfolio-opportunity-pl-amount .pl-inline,
#portfolio-opportunity-pl-amount .pl-label,
#portfolio-opportunity-pl-amount .pl-amount,
#portfolio-opportunity-pl-amount .pl-percent-pill,
.transaction-item .transaction-pl--dashboard .pl-inline,
.transaction-item .transaction-pl--dashboard .pl-amount,
.transaction-item .transaction-pl--dashboard .pl-percent-pill {
    font-size: 0.782rem;
}

/* Transaction note tooltip — neutral bubble shown on hover */
.transaction-note-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 50;
    padding: 0.35rem 0.55rem;
    border-radius: 0.375rem;
    background: rgba(243, 244, 246, 0.98);
    color: #374151;
    font-style: italic;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: normal;
    max-width: 18rem;
    width: max-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
}
.dark .transaction-note-tooltip {
    background: rgba(55, 65, 81, 0.98);
    color: #e5e7eb;
}
.transaction-note-icon:hover .transaction-note-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Transaction list (modal) P/L — slightly larger than default, status wraps below */
.transaction-list-item .transaction-pl--list .pl-inline {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.2rem;
    font-size: 0.85rem;
}
.transaction-list-item .transaction-pl--list .pl-amount,
.transaction-list-item .transaction-pl--list .pl-percent-pill {
    font-size: 0.85rem;
}
.transaction-list-item .transaction-pl--list .pl-percent-pill {
    padding: 0.15rem 0.45rem;
}
.transaction-list-item .transaction-pl--list .pl-status-text {
    flex-basis: 100%;
    text-align: right;
    font-size: 0.72rem;
    opacity: 0.85;
}
@media (max-width: 640px) {
    .transaction-list-item .transaction-pl--list .pl-inline,
    .transaction-list-item .transaction-pl--list .pl-status-text {
        justify-content: flex-start;
        text-align: left;
    }
    /* XS: keep the source label (Live / Locked / Mixed) inline with the percent,
       don't wrap it to its own line. */
    .transaction-list-item .transaction-pl--list .pl-status-text {
        flex-basis: auto;
    }
}

/* Transaction opportunity P/L chip */
.transaction-pl-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-self: flex-start;
    max-width: 100%;
    margin-top: 0.15rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(229, 231, 235, 0.95);
    background: rgba(249, 250, 251, 0.96);
}

.dark .transaction-pl-chip {
    border-color: rgba(75, 85, 99, 0.95);
    background: rgba(31, 41, 55, 0.9);
}

.transaction-pl-chip.is-positive {
    background: rgba(236, 253, 245, 0.95);
    border-color: rgba(167, 243, 208, 0.9);
}

.dark .transaction-pl-chip.is-positive {
    background: rgba(20, 83, 45, 0.28);
    border-color: rgba(22, 163, 74, 0.35);
}

.transaction-pl-chip.is-negative {
    background: rgba(254, 242, 242, 0.95);
    border-color: rgba(254, 202, 202, 0.9);
}

.dark .transaction-pl-chip.is-negative {
    background: rgba(127, 29, 29, 0.26);
    border-color: rgba(248, 113, 113, 0.32);
}

.transaction-pl-chip.is-neutral,
.transaction-pl-chip.is-unavailable,
.transaction-pl-chip.is-loading {
    background: rgba(249, 250, 251, 0.96);
    border-color: rgba(229, 231, 235, 0.95);
}

.dark .transaction-pl-chip.is-neutral,
.dark .transaction-pl-chip.is-unavailable,
.dark .transaction-pl-chip.is-loading {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(75, 85, 99, 0.95);
}

.transaction-pl-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.transaction-pl-value {
    font-size: 0.84rem;
    line-height: 1.15rem;
    font-weight: 600;
    color: #111827;
}

.dark .transaction-pl-value {
    color: #f3f4f6;
}

.transaction-pl-chip.is-unavailable .transaction-pl-value,
.transaction-pl-chip.is-loading .transaction-pl-value {
    color: #6b7280;
}

.dark .transaction-pl-chip.is-unavailable .transaction-pl-value,
.dark .transaction-pl-chip.is-loading .transaction-pl-value {
    color: #d1d5db;
}

.transaction-pl-percent {
    font-size: 0.72rem;
    line-height: 1rem;
    font-weight: 600;
    color: #6b7280;
}

.dark .transaction-pl-percent {
    color: #9ca3af;
}

.transaction-pl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    line-height: 0.95rem;
    color: #6b7280;
}

.dark .transaction-pl-meta {
    color: #9ca3af;
}

.transaction-pl-separator {
    opacity: 0.6;
}

.transaction-pl-status {
    font-weight: 600;
}

.transaction-pl-source {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: none;
    background: rgba(229, 231, 235, 0.9);
    color: #4b5563;
}

.dark .transaction-pl-source {
    background: rgba(75, 85, 99, 0.5);
    color: #d1d5db;
}

.transaction-pl-source.is-source-live {
    background: rgba(220, 252, 231, 0.9);
    color: #166534;
}

.dark .transaction-pl-source.is-source-live {
    background: rgba(21, 128, 61, 0.35);
    color: #bbf7d0;
}

.transaction-pl-source.is-source-locked {
    background: rgba(219, 234, 254, 0.9);
    color: #1d4ed8;
}

.dark .transaction-pl-source.is-source-locked {
    background: rgba(29, 78, 216, 0.3);
    color: #bfdbfe;
}

.transaction-pl-source.is-source-mixed {
    background: rgba(254, 243, 199, 0.9);
    color: #b45309;
}

.dark .transaction-pl-source.is-source-mixed {
    background: rgba(180, 83, 9, 0.3);
    color: #fde68a;
}

.transaction-pl-source.is-source-unavailable {
    background: rgba(229, 231, 235, 0.9);
    color: #6b7280;
}

.dark .transaction-pl-source.is-source-unavailable {
    background: rgba(75, 85, 99, 0.5);
    color: #d1d5db;
}

.transaction-pl-chip.transaction-pl--dashboard {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.32rem;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
    margin-top: 0.05rem;
    padding: 0;
    white-space: nowrap;
    background: transparent;
    border-color: transparent;
}

.transaction-list-pl-slot {
    min-width: 0;
    margin-left: auto;
}

.transaction-pl-chip.transaction-pl--inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    width: auto;
    max-width: 100%;
    margin-top: 0;
    padding: 0;
    white-space: nowrap;
    /* No outer chip background/border — only the percent pill carries its own background.
       Use !important to beat the dark-mode .is-positive / .is-negative chip overrides
       (which otherwise re-apply a red/green background around the whole row in dark mode). */
    background: transparent !important;
    border-color: transparent !important;
}

@media (max-width: 640px) {
    .transaction-list-pl-slot {
        align-self: center;
    }

    .transaction-pl-chip.transaction-pl--inline {
        white-space: normal;
        max-width: calc(100vw - 13rem);
    }

    /* XS: left-align the P/L chip inside the transaction-list-item (overrides
       the chip's default align-self:center + justify-content:flex-end). */
    .transaction-list-item .transaction-pl-chip.transaction-pl--inline {
        align-self: flex-start;
        justify-content: flex-start;
        max-width: 100%;
    }
    .transaction-list-item .transaction-pl-chip.transaction-pl--inline .pl-inline {
        justify-content: flex-start;
    }
}

/* Settings card — plain white dashboard-style card */
.settings-card {
    position: relative;
}

/* Support knowledge base accordion */
.support-chevron {
    transition: transform 0.2s ease;
}

.support-article-content {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================
   Transactions Grid
   =================== */

/* (Border-bottom rules removed — transaction items are now self-contained
   gray cards, not list rows.) */

/* ===================
   Modal Form Styles
   =================== */

/* Floating label input focus state */
.modal-content input:focus {
    outline: none;
}

.modal-content .relative:has(input:focus) {
    border-color: #6366f1;
}

/* Custom checkbox styling */
#archived {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dark #archived {
    background-color: #151a27;
    border-color: #30374c;
}

#archived:checked {
    background-color: #6366f1;
    border: none;
}

#archived:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

#archived:focus {
    box-shadow: none;
    outline: none;
}

#portfolio-archived,
#portfolio-favorite {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dark #portfolio-archived,
.dark #portfolio-favorite {
    background-color: #151a27;
    border-color: #30374c;
}

#portfolio-archived:checked,
#portfolio-favorite:checked {
    background-color: #6366f1;
    border: none;
}

#portfolio-archived:checked::after,
#portfolio-favorite:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

#portfolio-archived:focus,
#portfolio-favorite:focus {
    box-shadow: none;
    outline: none;
}

/* ===================
   Focus States
   =================== */

/* Remove focus outlines/borders from all interactive elements */
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
[data-lucide]:focus,
[data-lucide]:focus-visible,
.theme-btn:focus,
.theme-btn:focus-visible,
.calendar-nav:focus,
.calendar-nav:focus-visible,
a:focus,
a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ===================
   Cross-Platform Form Styles
   =================== */

/* Base form element resets */
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="password"],
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.5rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    line-height: 1.5;
}

/* Unified form field sizing — single source of truth for input/select/textarea
   height. Change padding-top/padding-bottom/font-size/line-height here to
   resize every form field across the app. Horizontal padding stays on the
   element via Tailwind utilities (px-3, or pl-9/pr-8 for icon-padded fields). */
.form-field {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
}

.api-key-password-input {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: 0;
    font-size: 16px;
}

/* Select element with custom arrow */
select.form-select,
select#transaction-portfolio,
select#currency-select,
select#topic {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dark select.form-select,
.dark select#transaction-portfolio,
.dark select#currency-select,
.dark select#topic {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Remove default select arrow in IE/Edge */
select::-ms-expand {
    display: none;
}

.native-select-field {
    position: relative;
}

.native-select-field__native {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
    border-radius: inherit;
    padding-right: 2.75rem;
}

.native-select-field__arrow {
    pointer-events: none;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
}

/* Number input - hide spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Datetime-local custom styling */
input[type="datetime-local"] {
    position: relative;
}

/* Make date/time picker clickable area larger */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    cursor: pointer;
    opacity: 0;
}

/* Visible calendar icon */
input[type="datetime-local"]::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3e%3cline x1='16' y1='2' x2='16' y2='6'/%3e%3cline x1='8' y1='2' x2='8' y2='6'/%3e%3cline x1='3' y1='10' x2='21' y2='10'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.dark input[type="datetime-local"]::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3e%3cline x1='16' y1='2' x2='16' y2='6'/%3e%3cline x1='8' y1='2' x2='8' y2='6'/%3e%3cline x1='3' y1='10' x2='21' y2='10'/%3e%3c/svg%3e");
}

/* Dark mode datetime-local input styling */
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* Dark mode number input spinner */
.dark input[type="number"]::-webkit-inner-spin-button,
.dark input[type="number"]::-webkit-outer-spin-button {
    filter: invert(0.7);
}

/* Placeholder text color */
input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.dark input::placeholder {
    color: #737b91;
}

/* Autofill background fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
    -webkit-text-fill-color: inherit;
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    transition: background-color 5000s ease-in-out 0s;
}

.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:focus,
.dark select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #151a27 inset;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="number"],
    input[type="datetime-local"],
    select {
        font-size: 16px !important;
    }
}

/* ===================
   Responsive Styles
   =================== */

/* (Per-breakpoint border-bottom rules removed — see note above.) */

/* ===================
   Breakpoint Indicator (Debug)
   =================== */

#breakpoint-indicator {
    transition: background-color 0.3s ease, border-color 0.3s ease;
    /* Default (xs): < 640px - Indigo */
    background-color: rgba(99, 102, 241, 0.75);
    border-color: rgba(99, 102, 241, 0.9);
}

/* sm: 640px+ - Purple */
@media (min-width: 640px) {
    #breakpoint-indicator {
        background-color: rgba(139, 92, 246, 0.75);
        border-color: rgba(139, 92, 246, 0.9);
    }
}

/* md: 768px+ - Orange */
@media (min-width: 768px) {
    #breakpoint-indicator {
        background-color: rgba(249, 115, 22, 0.75);
        border-color: rgba(249, 115, 22, 0.9);
    }
}

/* lg: 1024px+ - Emerald */
@media (min-width: 1024px) {
    #breakpoint-indicator {
        background-color: rgba(16, 185, 129, 0.75);
        border-color: rgba(16, 185, 129, 0.9);
    }
}

/* xl: 1280px+ - Yellow/Amber */
@media (min-width: 1280px) {
    #breakpoint-indicator {
        background-color: rgba(251, 191, 36, 0.75);
        border-color: rgba(251, 191, 36, 0.9);
    }
}

/* 2xl: 1536px+ - Rose/Pink */
@media (min-width: 1536px) {
    #breakpoint-indicator {
        background-color: rgba(244, 63, 94, 0.75);
        border-color: rgba(244, 63, 94, 0.9);
    }
}
