/* High Contrast Premium Dark Theme for Modals */

.modal-content.high-readability {
    background-color: #1a1a1a !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh !important;
    /* Dynamic based on resolution */
    margin: 10px auto !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

/* Ensure modal dialog stays within viewport limits */
.modal-dialog.modal-dialog-centered,
.modal-dialog.modal-dialog-scrollable {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 1rem) !important;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 550px !important;
        margin: 1.75rem auto !important;
    }
}

.modal-body.high-readability {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 1.5rem !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    scrollbar-width: thin;
    scrollbar-color: #ffffff #1a1a1a;
    -webkit-overflow-scrolling: touch;
}

.modal-header.high-readability {
    border-bottom: 2px solid #ffffff !important;
    padding: 1rem 1.25rem !important;
    flex: 0 0 auto !important;
}

/* Header colors */
.modal-header.high-readability.bg-success {
    background-color: #1b5e20 !important;
}

.modal-header.high-readability.bg-primary {
    background-color: #0d47a1 !important;
}

.modal-header.high-readability.bg-info {
    background-color: #006064 !important;
}

.modal-title.high-readability {
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 1.25rem !important;
    letter-spacing: 0.5px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-footer.high-readability {
    background-color: #262626 !important;
    border-top: 2px solid #ffffff !important;
    padding: 1rem !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    gap: 15px !important;
    flex: 0 0 auto !important;
}

.modal-footer.high-readability .btn {
    min-width: 120px !important;
    font-weight: 700 !important;
    padding: 0.6rem 1.25rem !important;
    border-radius: 8px !important;
}

/* Responsive Overrides */
@media (max-width: 576px) {
    .modal-content.high-readability {
        max-height: 94vh !important;
    }

    .modal-footer.high-readability {
        flex-direction: column-reverse !important;
        /* Stack: Primary on top */
        gap: 10px !important;
        padding: 0.75rem !important;
    }

    .modal-footer.high-readability .btn {
        width: 100% !important;
        min-width: auto !important;
        padding: 0.8rem !important;
    }

    .high-readability .row>div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .modal-body.high-readability {
        padding: 1.25rem !important;
    }
}

/* Form Elements */
.high-readability .form-label {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.5rem !important;
}

.high-readability .form-control,
.high-readability .form-select {
    background-color: #262626 !important;
    color: #ffffff !important;
    border: 2px solid #666666 !important;
    font-size: 1rem !important;
    padding: 0.75rem !important;
}

.high-readability .form-control:focus,
.high-readability .form-select:focus {
    border-color: #00e676 !important;
    background-color: #262626 !important;
    color: #ffffff !important;
}

.high-readability .form-text {
    color: #00e676 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.high-readability .btn-close {
    filter: invert(1) brightness(2) !important;
}

/* Buttons */
.high-readability .btn-success {
    background-color: #2e7d32 !important;
    color: #ffffff !important;
    border: none !important;
}

.high-readability .btn-primary {
    background-color: #1565c0 !important;
    color: #ffffff !important;
    border: none !important;
}

.high-readability .btn-secondary {
    background-color: #424242 !important;
    color: #ffffff !important;
    border: none !important;
}

.high-readability .btn-info {
    background-color: #00838f !important;
    color: #ffffff !important;
    border: none !important;
}

/* Terms Box - Ensure all text is visible in dark modal */
.high-readability .terms-box,
.terms-box {
    max-height: 250px;
    overflow-y: auto;
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    scrollbar-width: thin;
    scrollbar-color: #ffffff #333;
}

.high-readability .terms-box h2,
.high-readability .terms-box h3,
.high-readability .terms-box h4,
.high-readability .terms-box p,
.high-readability .terms-box li,
.high-readability .terms-box strong,
.terms-box h2,
.terms-box h3,
.terms-box h4,
.terms-box p,
.terms-box li,
.terms-box strong {
    color: #ffffff !important;
}

.high-readability .terms-box ul,
.high-readability .terms-box ol,
.terms-box ul,
.terms-box ol {
    color: #ffffff !important;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.high-readability .terms-box li,
.terms-box li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #ffffff !important;
}

.high-readability .terms-box h3,
.terms-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Terms box scrollbar styling */
.terms-box::-webkit-scrollbar {
    width: 6px;
}

.terms-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.terms-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.terms-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}