/* ==========================================================================
   Educare — unified modal / dialog design (MudBlazor dialogs)
   One look for every popup: rounded card, fixed header & footer, scrolling body,
   mobile-friendly sizing, dark mode. Loaded globally from App.razor.
   ========================================================================== */

.mud-overlay.mud-overlay-dialog {
    z-index: 1400;
}
.mud-overlay.mud-overlay-dialog .mud-overlay-scrim {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.mud-dialog {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 4px 14px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    animation: edu-dialog-in .16s ease-out;
}
@keyframes edu-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* Header */
.mud-dialog .mud-dialog-title {
    flex: 0 0 auto;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mud-dialog .mud-dialog-title .mud-typography-h6,
.mud-dialog .mud-dialog-title h6 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
}
.mud-dialog .mud-dialog-title .mud-button-close {
    margin-left: auto;
    position: static;
}

/* Body — scrolls, header/footer stay visible */
.mud-dialog .mud-dialog-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 20px;
    overscroll-behavior: contain;
}
.mud-dialog .mud-dialog-content .mud-input-control { margin-bottom: 4px; }

/* Footer / actions */
.mud-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    padding: 12px 20px;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.mud-dialog .mud-dialog-actions .mud-button-root {
    min-width: 92px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: none;
}

/* Phones: near full-screen sheet */
@media (max-width: 600px) {
    .mud-dialog-container .mud-dialog {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        margin: 8px;
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }
    .mud-dialog .mud-dialog-content { padding: 14px 14px; }
    .mud-dialog .mud-dialog-title,
    .mud-dialog .mud-dialog-actions { padding-left: 14px; padding-right: 14px; }
    .mud-dialog .mud-dialog-actions .mud-button-root { flex: 1 1 auto; }
}

/* Dark mode */
html.sm-dark .mud-dialog {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
html.sm-dark .mud-dialog .mud-dialog-title {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: #334155;
}
html.sm-dark .mud-dialog .mud-dialog-title .mud-typography-h6,
html.sm-dark .mud-dialog .mud-dialog-title h6 { color: #f1f5f9; }
html.sm-dark .mud-dialog .mud-dialog-actions {
    background: #0f172a;
    border-top-color: #334155;
}

@media print { .mud-overlay.mud-overlay-dialog { display: none !important; } }
