/* ==========================================================================
   Researcher Consent Edit Modal & Toast Stylesheet
   ========================================================================== */

/* 1. Modal Backdrop & Dialog Container */
.consent-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: opacity 0.2s ease-in-out !important;
}

.consent-modal-backdrop.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.consent-modal-dialog {
    width: 100%;
    max-width: 480px;
    background-color: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: consentModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .consent-modal-dialog {
    background-color: #0f172a;
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@keyframes consentModalPop {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 2. Header */
.consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

html.dark .consent-modal-header {
    border-bottom-color: rgba(51, 65, 85, 0.7);
}

.consent-modal-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

html.dark .consent-modal-title {
    color: #f8fafc;
}

.consent-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.consent-modal-close:hover {
    background-color: rgba(241, 245, 249, 1);
    color: #0f172a;
}

html.dark .consent-modal-close:hover {
    background-color: rgba(30, 41, 59, 0.8);
    color: #f8fafc;
}

/* 3. Body */
.consent-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.consent-researcher-card {
    background-color: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
}

html.dark .consent-researcher-card {
    background-color: rgba(15, 23, 42, 0.65);
    border-color: rgba(51, 65, 85, 0.75);
}

/* 4. Option Cards */
.consent-option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border-radius: 0.875rem;
    border: 1.5px solid #e2e8f0;
    background-color: #ffffff;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

html.dark .consent-option-card {
    border-color: #334155;
    background-color: rgba(30, 41, 59, 0.4);
}

.consent-option-card:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

html.dark .consent-option-card:hover {
    border-color: #475569;
    background-color: rgba(30, 41, 59, 0.7);
}

.consent-option-card.is-selected {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.06) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

html.dark .consent-option-card.is-selected {
    border-color: #34d1bf !important;
    background-color: rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.consent-option-radio-indicator {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: 9999px;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.15s ease;
    margin-top: 0.125rem;
}

html.dark .consent-option-radio-indicator {
    border-color: #475569;
}

.consent-option-card.is-selected .consent-option-radio-indicator {
    border-color: #10b981;
    background-color: #10b981;
    color: #ffffff;
}

html.dark .consent-option-card.is-selected .consent-option-radio-indicator {
    border-color: #10b981;
    background-color: #10b981;
    color: #ffffff;
}

.consent-option-content {
    flex: 1;
    min-width: 0;
}

/* 5. Alerts */
.consent-modal-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #e11d48;
}

html.dark .consent-modal-alert {
    background-color: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

/* 6. Footer Buttons */
.consent-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

html.dark .consent-modal-footer {
    background-color: rgba(15, 23, 42, 0.7);
    border-top-color: rgba(51, 65, 85, 0.7);
}

.consent-btn-cancel {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.consent-btn-cancel:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

html.dark .consent-btn-cancel {
    background-color: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}

html.dark .consent-btn-cancel:hover {
    background-color: #334155;
    color: #ffffff;
}

.consent-btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.75rem;
    background-color: #059669;
    color: #ffffff;
    border: 1px solid #047857;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.consent-btn-save:hover:not(:disabled) {
    background-color: #047857;
}

.consent-btn-save:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 7. Action Button on Table List */
.open-consent-modal-btn {
    cursor: pointer;
    user-select: none;
}

.open-consent-modal-btn:hover {
    transform: scale(1.06);
}

/* 8. Floating Toast Notification */
.consent-toast {
    position: fixed !important;
    bottom: 1.5rem !important;
    right: 1.5rem !important;
    z-index: 100010 !important;
    max-width: 360px;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0.875rem 1.125rem;
    animation: consentToastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .consent-toast {
    background-color: #0f172a;
    border-color: rgba(51, 65, 85, 0.85);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.consent-toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes consentToastSlideIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
