﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('icons-1.8.1/font/bootstrap-icons.css');

.amount-positive {
    color: var(--bs-success);
}

.amount-negative {
    color: var(--bs-danger);
}

html, body {
    font-family: Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Elevate cards containing open dropdowns above sibling cards */
.card:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1050;
    opacity: 1 !important;
}

/* Smooth theme transitions after initial load */
* {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Dark mode styles */
[data-bs-theme="dark"] {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] body {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] main {
    background-color: #212529;
}

[data-bs-theme="dark"] .content {
    background-color: #212529;
}

[data-bs-theme="dark"] article {
    background-color: #212529;
}

[data-bs-theme="dark"] .card {
    background-color: #2b3035;
    --card-bg: #2b3035;
    color: #dee2e6;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #2b3035 !important;
    border-bottom: 1px solid #495057;
}

[data-bs-theme="dark"] .card-header .btn-link {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #2b3035 !important;
    border-top: 1px solid #495057;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .border {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:active {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    border-color: #495057;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:active,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-secondary {
    background-color: #495057;
    border-color: #6c757d;
    color: #fff;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #495057;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .form-select {
    background-color: #2b3035;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-select:focus {
    background-color: #2b3035;
    border-color: #6c757d;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control {
    background-color: #2b3035;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: #2b3035;
    border-color: #6c757d;
    color: #dee2e6;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6c757d;
}

[data-bs-theme="dark"] .form-label {
    color: #dee2e6;
}

[data-bs-theme="dark"] .top-row {
    background-color: #1a1d20 !important;
    border-bottom: none !important;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .top-row .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .top-row .btn {
    color: #adb5bd;
}

[data-bs-theme="dark"] .top-row .btn:hover {
    color: #dee2e6;
}

[data-bs-theme="dark"] .top-row span[class*="bi-"] {
    color: inherit;
}

[data-bs-theme="dark"] .top-row .navbar-text {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .top-row .navbar-text b {
    color: #adb5bd !important;
    font-weight: 600;
}

/* Dark mode link styles */
[data-bs-theme="dark"] a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] a:hover {
    color: #8bb9fe;
}

[data-bs-theme="dark"] a.text-decoration-none {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] a.text-decoration-none:hover {
    color: #f8f9fa !important;
}

/* Ensure links in components have proper colors */
[data-bs-theme="dark"] .small a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .lead {
    color: #f8f9fa;
}

/* Fix for bold text in links */
[data-bs-theme="dark"] a b,
[data-bs-theme="dark"] a strong {
    color: inherit;
}

/* Dark mode table styles */
[data-bs-theme="dark"] .table {
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .table thead {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .table tbody {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .table-responsive {
    color: #dee2e6;
}

[data-bs-theme="dark"] .table-warning {
    --bs-table-bg: rgba(255, 193, 7, 0.2);
    --bs-table-color: #dee2e6;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #2b3035;
    --bs-table-color: #dee2e6;
}

[data-bs-theme="dark"] .table-secondary {
    --bs-table-bg: rgba(108, 117, 125, 0.3);
    --bs-table-color: #dee2e6;
}

[data-bs-theme="dark"] th {
    color: #f8f9fa;
}

[data-bs-theme="dark"] td {
    color: #dee2e6;
}

/* Dark mode chart styles */
[data-bs-theme="dark"] canvas {
    background-color: transparent;
}

/* Progress bars in dark mode */
[data-bs-theme="dark"] .progress {
    background-color: #495057;
}

[data-bs-theme="dark"] .progress-bar {
    background-color: #0d6efd;
}

/* Dark mode search field styles */
[data-bs-theme="dark"] .bg-light {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #2b3035;
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] .list-group-item-action:hover {
    background-color: #343a40;
    color: #dee2e6;
}

[data-bs-theme="dark"] .list-group-item-action.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

[data-bs-theme="dark"] .spinner-border {
    color: #dee2e6;
}

/* Dark mode modal/dialog styles */
[data-bs-theme="dark"] .modal-content {
    background-color: #2b3035;
    color: #dee2e6;
}

[data-bs-theme="dark"] .modal-header {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .modal-title {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Enhanced modal shadow for better depth */
.modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .modal-content {
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

/* Modal backdrop */
.modal.show.d-block {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .modal.show.d-block {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Dark mode button styles */
[data-bs-theme="dark"] .btn-success {
    background-color: #30d158;
    border-color: #30d158;
    color: #fff;
}

[data-bs-theme="dark"] .btn-success:hover,
[data-bs-theme="dark"] .btn-success:active {
    background-color: #32d65a;
    border-color: #34db5c;
    color: #fff;
}

[data-bs-theme="dark"] .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

[data-bs-theme="dark"] .btn-danger:hover,
[data-bs-theme="dark"] .btn-danger:active {
    background-color: #bb2d3b;
    border-color: #b02a37;
    color: #fff;
}

[data-bs-theme="dark"] .btn-danger span[class*="bi-"] {
    color: #fff;
}

[data-bs-theme="dark"] .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

[data-bs-theme="dark"] .btn-warning:hover,
[data-bs-theme="dark"] .btn-warning:active {
    background-color: #ffca2c;
    border-color: #ffc720;
    color: #000;
}

[data-bs-theme="dark"] .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-secondary:active {
    background-color: #5c636a;
    border-color: #565e64;
    color: #fff;
}

/* Dark mode success utility classes */
[data-bs-theme="dark"] .bg-success {
    background-color: #30d158 !important;
}

[data-bs-theme="dark"] .text-success {
    color: #30d158 !important;
}

[data-bs-theme="dark"] .badge.bg-success {
    background-color: #30d158 !important;
    color: #fff !important;
}

h1:focus {
    outline: none;
}

#components-reconnect-modal { /* dont show blazor reconnect screen */
    display: none !important;
}

.content {
    padding-top: 1.1rem;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #000;
}

[data-bs-theme="dark"] #blazor-error-ui {
    background: #ffc107;
    color: #000;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.5);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}


.fade-in {
    animation: fade-in 0.2s ease-in-out;
}

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

    to {
        opacity: 1;
    }
}

/* anim-flip-y class and keyframes*/
.anim-flip-y {
    animation-name: spin, depth;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: 2s;
}

@keyframes spin {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-360deg);
    }
}

@keyframes depth {
    0% {
        text-shadow: 0 0 black;
    }

    25% {
        text-shadow: 1px 0 black, 2px 0 black, 3px 0 black, 4px 0 black, 5px 0 black;
    }

    50% {
        text-shadow: 0 0 black;
    }

    75% {
        text-shadow: -1px 0 black, -2px 0 black, -3px 0 black, -4px 0 black, -5px 0 black;
    }

    100% {
        text-shadow: 0 0 black;
    }
}

/* Toast styling */
.toast-visible {
    display: block;
    opacity: 1;
    min-width: 300px;
    max-width: 500px;
    margin-bottom: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-body {
    padding: 0.75rem;
}

.toast .btn-close {
    padding: 0.5rem;
    margin: 0;
}

/* Ended organizations (line-through) should be muted */
a.text-decoration-line-through {
    color: #6c757d !important;
}

[data-bs-theme="dark"] a.text-decoration-line-through {
    color: #6c757d !important;
}

/* Three-dots menu should be white in dark mode */
[data-bs-theme="dark"] .text-black {
    color: #ffffff !important;
}

/* Dark mode nav-tabs styles */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #adb5bd;
    background-color: transparent;
    border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus {
    color: #dee2e6;
    border-color: #495057 #495057 transparent;
    background-color: #2b3035;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    color: #fff;
    background-color: #212529;
    border-color: #495057 #495057 #212529;
}

/* Dark mode success background styles for detected phone number cards */
[data-bs-theme="dark"] .bg-success.bg-opacity-10 {
    background-color: rgba(48, 209, 88, 0.15) !important;
}

[data-bs-theme="dark"] .bg-success.bg-opacity-10 code {
    color: #dee2e6;
    background-color: rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .bg-success.bg-opacity-10 .badge.bg-success {
    background-color: #30d158 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.badge-subtle {
    color: #999 !important;
}
[data-bs-theme="dark"] .badge-subtle {
    color: #888 !important;
}
.badge-subtle.text-danger {
    color: var(--bs-danger) !important;
}
.badge-subtle.text-warning {
    color: var(--bs-warning) !important;
}
/* Dark mode accordion styles */
[data-bs-theme="dark"] .accordion-item {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .accordion-button {
    background-color: #2b3035;
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #343a40;
    color: #fff;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .accordion-button:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

[data-bs-theme="dark"] .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .accordion-body {
    background-color: #2b3035;
    color: #dee2e6;
}

/* Dark mode alert styles */
[data-bs-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.3);
    color: #dee2e6;
}

[data-bs-theme="dark"] .alert-info .text-info {
    color: #6edff6 !important;
}

[data-bs-theme="dark"] .alert-info .text-body-secondary {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .alert-primary {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    color: #dee2e6;
}

[data-bs-theme="dark"] .alert-primary .text-primary {
    color: #6ea8fe !important;
}

[data-bs-theme="dark"] .alert-primary .text-body-secondary {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #dee2e6;
}

[data-bs-theme="dark"] .alert-warning .text-warning {
    color: #ffda6a !important;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dee2e6;
}

[data-bs-theme="dark"] .alert-danger .text-danger {
    color: #ea868f !important;
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(48, 209, 88, 0.1);
    border-color: rgba(48, 209, 88, 0.3);
    color: #dee2e6;
}

/* Email body rendering - constrain image sizes */
.email-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.email-body img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}


/* Snowflake dark mode override (can't use CSS isolation for ancestor selectors) */
[data-bs-theme="dark"] .snowflake {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

/* Festive top bar accent - Christmas */
.top-row.season-christmas {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #c41e3a 0%, #228b22 25%, #c41e3a 50%, #228b22 75%, #c41e3a 100%) 1;
}

[data-bs-theme="dark"] .top-row.season-christmas {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #ff4d6d 0%, #4ade80 25%, #ff4d6d 50%, #4ade80 75%, #ff4d6d 100%) 1;
}

/* Festive top bar accent - Winter (Dec 27-30, snow only) */
.top-row.season-winter {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #6ba3d6 0%, #87ceeb 50%, #6ba3d6 100%) 1;
}

[data-bs-theme="dark"] .top-row.season-winter {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #87ceeb 0%, #b0e0e6 50%, #87ceeb 100%) 1;
}

/* Festive top bar accent - New Year */
.top-row.season-newyear {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #ffd700 0%, #c0c0c0 25%, #ffd700 50%, #c0c0c0 75%, #ffd700 100%) 1;
}

[data-bs-theme="dark"] .top-row.season-newyear {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #ffdf00 0%, #e8e8e8 25%, #ffdf00 50%, #e8e8e8 75%, #ffdf00 100%) 1;
}
