@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Custom Family Todo Styles */
.page {
    min-height: 100vh;
}

.avatar-circle {
    display: inline-block;
}

.badge-rank {
    font-size: 0.875em;
    min-width: 2rem;
}

.task-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.achievement-icon {
    transition: filter 0.3s ease-in-out;
}

.achievement-requirements {
    font-size: 0.875rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.unlock-date, .lock-indicator {
    font-size: 0.75rem;
}

/* Priority indicators */
.priority-urgent {
    border-left: 4px solid #dc3545;
}

.priority-high {
    border-left: 4px solid #fd7e14;
}

.priority-medium {
    border-left: 4px solid #0dcaf0;
}

.priority-low {
    border-left: 4px solid #6c757d;
}

/* Landing page styles */
.display-4 {
    font-weight: 300;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Dashboard card improvements */
.dashboard-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    border-radius: 0.5rem;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dashboard-card .card-title {
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    font-size: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .top-row {
        padding: 0.5rem 1rem;
    }
}

/* Enhanced contrast for better readability */
.card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #212529;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.card-body {
    color: #212529;
}

.card-title {
    color: #212529;
    font-weight: 600;
}

.card-text {
    color: #495057;
}

/* Ensure good contrast for text on light backgrounds */
.text-muted {
    color: #6c757d !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .card-header {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .card-body {
        color: #e2e8f0;
    }
    
    .card-title {
        color: #f7fafc;
    }
    
    .card-text {
        color: #cbd5e0;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    body {
        background-color: #1a202c !important;
        color: #e2e8f0 !important;
    }
    
    html {
        background-color: #1a202c !important;
    }
    
    /* Ensure main content areas are dark */
    .container-fluid,
    .container {
        background-color: transparent;
    }
    
    /* Dark mode navigation */
    .navbar {
        background-color: #2d3748 !important;
        border-bottom: 1px solid #4a5568;
    }
    
    .navbar-brand,
    .nav-link {
        color: #e2e8f0 !important;
    }
    
    .nav-link:hover {
        color: #f7fafc !important;
    }
    
    /* Dark mode forms */
    .form-control,
    .form-select {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #2d3748;
        border-color: #6ea8fe;
        color: #e2e8f0;
        box-shadow: 0 0 0 0.25rem rgba(110, 168, 254, 0.25);
    }
}

#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;
}

    #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."
    }

/* Ensure proper text contrast on dark backgrounds */
.bg-primary {
    color: white !important;
}

.bg-secondary {
    color: white !important;
}

.bg-success {
    color: white !important;
}

.bg-info {
    color: white !important;
}

.bg-danger {
    color: white !important;
}

.bg-dark {
    color: white !important;
}

/* Warning background should use dark text for better contrast */
.bg-warning {
    color: #212529 !important;
}

/* Ensure badges have proper contrast */
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-success,
.badge.bg-info,
.badge.bg-danger,
.badge.bg-dark {
    color: white !important;
}

.badge.bg-warning {
    color: #212529 !important;
}

/* Enhanced contrast for colored text elements */
.text-primary {
    color: #0d6efd !important;
    font-weight: 600;
}

.text-success {
    color: #198754 !important;
    font-weight: 600;
}

.text-info {
    color: #0dcaf0 !important;
    font-weight: 600;
}

.text-warning {
    color: #ffc107 !important;
    font-weight: 600;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Improve small text readability */
small.text-muted {
    color: #6c757d !important;
    font-size: 0.875rem;
}

/* UNIVERSAL DARK THEME - Force dark background always */
html, body {
    background-color: #1a202c !important;
    color: #e2e8f0 !important;
}

.page {
    background-color: #1a202c !important;
    min-height: 100vh;
}

.sidebar {
    background-color: #2d3748 !important;
    border-right: 1px solid #4a5568 !important;
}

.top-row {
    background-color: #2d3748 !important;
    border-bottom: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

.content {
    background-color: #1a202c !important;
    color: #e2e8f0 !important;
}

/* Fix ALL text in cards to be light colored */
.card {
    background-color: #2d3748 !important;
    border: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

.card-header {
    background-color: #4a5568 !important;
    border-bottom: 1px solid #718096 !important;
    color: #e2e8f0 !important;
}

.card-body {
    color: #e2e8f0 !important;
}

/* FORCE ALL TEXT IN CARDS TO BE LIGHT */
.card .card-body h1,
.card .card-body h2,
.card .card-body h3,
.card .card-body h4,
.card .card-body h5,
.card .card-body h6,
.card .card-body p,
.card .card-body small,
.card .card-body div,
.card .card-body span:not(.badge):not(.oi),
.card h6,
.card h6.card-title,
.card .card-title {
    color: #f7fafc !important;
    font-weight: 600;
}

.card .card-body .text-muted,
.card .card-body small.text-muted,
.card .card-body .card-text {
    color: #a0aec0 !important;
}

.card .card-body strong {
    color: #f7fafc !important;
    font-weight: 600;
}

/* Dark navigation and forms */
.navbar-brand {
    color: #e2e8f0 !important;
}

.nav-link {
    color: #e2e8f0 !important;
}

.nav-link:hover {
    color: #f7fafc !important;
}

.form-control,
.form-select {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #2d3748 !important;
    border-color: #6ea8fe !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 0 0.25rem rgba(110, 168, 254, 0.25) !important;
}

.form-control::placeholder {
    color: #a0aec0 !important;
}

/* Fix all headings */
h1, h2, h3, h4, h5, h6 {
    color: #f7fafc !important;
}

/* Fix main text */
p, div, span:not(.badge):not(.oi) {
    color: #e2e8f0 !important;
}

/* MODAL DARK THEME - Force override Bootstrap styles */
.modal .modal-content,
div.modal-content {
    background-color: #2d3748 !important;
    border: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

.modal .modal-header,
div.modal-header {
    background-color: #4a5568 !important;
    border-bottom: 1px solid #718096 !important;
    color: #e2e8f0 !important;
}

.modal .modal-title,
h5.modal-title {
    color: #f7fafc !important;
    font-weight: 600;
}

.modal .modal-body,
div.modal-body {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

.modal .modal-footer,
div.modal-footer {
    background-color: #2d3748 !important;
    border-top: 1px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

/* Force all text in modals to be light */
.modal h1, .modal h2, .modal h3, .modal h4, .modal h5, .modal h6,
.modal p, .modal div, .modal span:not(.badge):not(.oi) {
    color: #e2e8f0 !important;
}

/* Modal form elements */
.modal .form-control,
.modal .form-select {
    background-color: #1a202c !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

.modal .form-control:focus,
.modal .form-select:focus {
    background-color: #1a202c !important;
    border-color: #6ea8fe !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 0 0.25rem rgba(110, 168, 254, 0.25) !important;
}

.modal .form-control::placeholder {
    color: #a0aec0 !important;
}

.modal .form-label {
    color: #f7fafc !important;
    font-weight: 600;
}

.modal .form-text {
    color: #a0aec0 !important;
}

/* Modal buttons */
.modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modal backdrop should be darker */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* EMERGENCY MODAL DARK THEME - Very specific selectors */
div[class*="modal"] div[class*="modal-content"] {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

div[class*="modal"] div[class*="modal-header"] {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

div[class*="modal"] div[class*="modal-body"] {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

/* Target by style attribute for inline modals */
div[style*="display: block"] .modal-content {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

div[style*="display: block"] .modal-header {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

div[style*="display: block"] .modal-body {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

/* Dark mode adjustments for colored text */
@media (prefers-color-scheme: dark) {
    .text-primary {
        color: #6ea8fe !important;
    }
    
    .text-success {
        color: #75b798 !important;
    }
    
    .text-info {
        color: #6edff6 !important;
    }
    
    .text-warning {
        color: #ffda6a !important;
    }
    
    .text-danger {
        color: #ea868f !important;
    }
    
    small.text-muted {
        color: #adb5bd !important;
    }
    
    /* Force proper contrast on all card content in dark mode */
    .card .card-body h1,
    .card .card-body h2,
    .card .card-body h3,
    .card .card-body h4,
    .card .card-body h5,
    .card .card-body h6,
    .card .card-body p,
    .card .card-body small,
    .card .card-body div,
    .card .card-body span:not(.badge):not(.oi) {
        color: #e2e8f0 !important;
    }
    
    .card .card-body .text-muted,
    .card .card-body small.text-muted {
        color: #a0aec0 !important;
    }
    
    .card .card-body strong {
        color: #f7fafc !important;
        font-weight: 600;
    }
    
    /* Fix task card titles in dark mode */
    .card .card-title,
    .card h6.card-title,
    .card .card-body h6.card-title {
        color: #f7fafc !important;
        font-weight: 600;
    }
    
    /* Fix task card description text in dark mode */
    .card .card-body .card-text {
        color: #a0aec0 !important;
    }
}
