/* site-12-dashboard-layout.css: Action cards, page background, dashboard layout and entrance, welcome, document mode (36-40).
   Part of the old site.css, split by sections (same order: _Styles.cshtml links them one after the other,
   so the cascade is exactly the same). */

/* =====================================================================
   36. ACTION CARDS (white card, photo banner on top, color only in the details)
   ===================================================================== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 0 0 40px;
}

.action-card {
    --card-tint: 37, 66, 124;              /* rgb of the card color */
    --card-image: none;
    --card-image-filter: none;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(var(--card-tint), 0.22);
    border-radius: 18px;
    /* White tinted with the card color: same color as the photo, but soft */
    background: linear-gradient(180deg, rgba(var(--card-tint), 0.05) 0%, rgba(var(--card-tint), 0.11) 100%), #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 32px -22px rgba(15, 23, 42, 0.45);
    transition: transform 0.3s var(--sidebar-ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

    .action-card:hover {
        color: #0f172a;
        transform: translateY(-5px);
        border-color: rgba(var(--card-tint), 0.35);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 26px 44px -24px rgba(var(--card-tint), 0.75);
    }

    .action-card:focus-visible {
        outline: 3px solid rgba(var(--card-tint), 0.6);
        outline-offset: 3px;
    }

/* --- Photo banner --- */
.action-card-media {
    position: relative;
    height: 200px;
    overflow: hidden;
    isolation: isolate;
    background: rgb(var(--card-tint));
}

    .action-card-media::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -2;
        background: var(--card-image) center / cover no-repeat;
        filter: var(--card-image-filter);
        transition: transform 0.6s var(--sidebar-ease);
    }

    /* Tint of the card color, stronger at the bottom */
    .action-card-media::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(180deg, rgba(var(--card-tint), 0) 45%, rgba(var(--card-tint), 0.45) 100%);
    }

.action-card:hover .action-card-media::before {
    transform: scale(1.07);
}

.action-card-tag {
    position: absolute;
    top: 16px;
    right: 14px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- White body --- */
.action-card-body {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 22px 20px;
}

/* Icon half over the photo, half over the white */
.action-card-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: -27px 0 14px;
    border: 3px solid #fff;
    border-radius: 16px;
    background: rgb(var(--card-tint));
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 10px 20px -10px rgba(var(--card-tint), 0.9);
    transition: transform 0.3s var(--sidebar-ease);
}

.action-card:hover .action-card-icon {
    transform: translateY(-3px) rotate(-4deg);
}

.action-card-title {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.005em;
}

.action-card-text {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 0.93rem;
    line-height: 1.5;
}

.action-card-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(var(--card-tint), 0.16);
    color: rgb(var(--card-tint));
    font-size: 0.93rem;
    font-weight: 600;
}

    .action-card-button i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(var(--card-tint), 0.14);
        transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    }

.action-card:hover .action-card-button i {
    transform: translateX(3px);
    background: rgb(var(--card-tint));
    color: #fff;
}

/* Colors and photos of each card (--card-image-filter darkens a photo) */
.action-card--complaint {
    --card-tint: 30, 58, 107;
    --card-image: url("../images/cards/denuncia.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);
}

.action-card--violence {
    --card-tint: 76, 40, 130;
    --card-image: url("../images/cards/violencia.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);;
}

.action-card--act {
    --card-tint: 22, 92, 88;
    --card-image: url("../images/cards/acta.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);;
}

.action-card--testimony {
    --card-tint: 253, 186, 116;
    --card-image: url("../images/cards/testimonio.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);;
}

/* Testimonio VF: the violet of domestic violence with the photo of the testimony */
.action-card--violence-testimony {
    --card-tint: 76, 40, 130;
    --card-image: url("../images/cards/testimonio.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);
}

.action-card--imputation {
    --card-tint: 62, 72, 88;
    --card-image: url("../images/cards/imputar.jpg");
    --card-image-filter: brightness(0.90) contrast(1.05);;
}

/* Admin dashboard: three cards without photos; the color banner carries a big faded icon */
.action-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card-watermark {
    position: absolute;
    right: -6px;
    bottom: -26px;
    z-index: -1;
    color: rgba(255, 255, 255, 0.16);
    font-size: 9rem;
    line-height: 1;
    transform: rotate(-8deg);
    transition: transform 0.6s var(--sidebar-ease);
}

.action-card:hover .action-card-watermark {
    transform: rotate(-4deg) scale(1.06);
}

.action-card--court {
    --card-tint: 76, 40, 130;
    --card-image: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 55%),
                  linear-gradient(135deg, #3b1f6e 0%, #5b34a0 100%);
}

.action-card--station {
    --card-tint: 22, 92, 88;
    --card-image: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 55%),
                  linear-gradient(135deg, #0f4744 0%, #1c7a74 100%);
}

.action-card--user {
    --card-tint: 30, 58, 107;
    --card-image: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 55%),
                  linear-gradient(135deg, #142a52 0%, #284f94 100%);
}

@media (max-width: 1199.98px) {
    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .action-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .sidebar-scroll,
    .sidebar-collapse-btn,
    .sidebar-collapse-btn i,
    .action-card,
    .action-card-media::before,
    .action-card-icon {
        transition: none;
    }

}


/* =====================================================================
   37. PAGE BACKGROUND IMAGE
   ---------------------------------------------------------------------
   ONE variable for the background photo of the whole app: change it here and it changes
   everywhere (dashboards, citizen page, dark pages and the side menu).
   Pages that show the photo clean: ViewData["BodyClass"] = "page-dashboard" or "page-photo".
   ===================================================================== */
:root {
    --app-bg-image: url("../images/bg.jpg");
    /* Layer over the photo on the light pages. Transparent = only the photo, as it is.
       (to lighten or tint it some day: rgba(255, 255, 255, 0.5), for example) */
    --app-bg-tint: transparent;
}

body.page-dashboard,
body.page-photo {
    /* The photo with the soft grey-blue layer (not the dark layer of the other pages) */
    background-image: linear-gradient(var(--app-bg-tint), var(--app-bg-tint)), var(--app-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


/* =====================================================================
   38. DASHBOARD LAYOUT (light background: welcome, sections, quick access)
   ===================================================================== */
body.page-dashboard {
    --dash-ink: #0f172a;
    --dash-ink-soft: #475569;
    --dash-ink-muted: #64748b;
    --dash-line: rgba(15, 23, 42, 0.08);
}

/* Solid top bar: over a white background the translucent one looked grey */
body.page-dashboard .app-header-modern,
body.page-photo .app-header-modern {
    background: linear-gradient(90deg, #0b1328 0%, #121d3b 100%);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 6px 24px -12px rgba(15, 23, 42, 0.6);
}

body.page-dashboard .nav-brand-subtitle,
body.page-photo .nav-brand-subtitle {
    color: rgba(226, 232, 240, 0.7);
}

.dash {
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 24px;
}

/* --- Welcome --- */
.dash-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--dash-line);
}

.dash-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-title {
    margin: 0 0 6px;
    color: var(--dash-ink);
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.dash-subtitle {
    margin: 0;
    color: var(--dash-ink-soft);
    font-size: 1.05rem;
}

.dash-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .dash-meta li {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border: 1px solid var(--dash-line);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(6px);
        color: var(--dash-ink-soft);
        font-size: 0.9rem;
        font-weight: 500;
        box-shadow: 0 4px 14px -10px rgba(15, 23, 42, 0.4);
    }

        .dash-meta li i {
            color: #2563eb;
        }

.dash-section-title {
    margin: 0 0 16px;
    color: var(--dash-ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Quick access --- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.quick-tile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--dash-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    color: var(--dash-ink);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 28px -20px rgba(15, 23, 42, 0.5);
    transition: transform 0.25s var(--sidebar-ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

    .quick-tile:hover {
        color: var(--dash-ink);
        transform: translateY(-3px);
        border-color: rgba(37, 99, 235, 0.25);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 20px 36px -20px rgba(15, 23, 42, 0.55);
    }

    .quick-tile:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 3px;
    }

.quick-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.25rem;
}

.quick-icon--blue {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.quick-icon--teal {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.quick-icon--slate {
    background: rgba(71, 85, 105, 0.12);
    color: #334155;
}

.quick-body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.quick-title {
    font-size: 1.02rem;
    font-weight: 600;
}

.quick-text {
    overflow: hidden;
    color: var(--dash-ink-muted);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-alert {
    color: #b45309;
    font-weight: 600;
}

    .quick-alert::before {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-right: 6px;
        border-radius: 50%;
        background: #f59e0b;
        vertical-align: 1px;
    }

.quick-arrow {
    color: var(--dash-ink-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.quick-tile:hover .quick-arrow {
    color: #2563eb;
    transform: translateX(3px);
}

@media (max-width: 991.98px) {
    .quick-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* =====================================================================
   39. DASHBOARD ENTRANCE (first the greeting, then the name, then the menu)
   ===================================================================== */
@keyframes dash-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes dash-line {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Every piece waits hidden ("backwards" = the first frame applies during the delay)
   and appears at its own time; after the animation the normal styles apply again,
   so the hover of the cards keeps working */
.dash--intro .dash-greeting,
.dash--intro .dash-name,
.dash--intro .dash-subtitle,
.dash--intro .dash-section-title,
.dash--intro .action-card {
    animation: dash-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.dash-greeting,
.dash-name {
    display: inline-block;
}

.dash--intro .dash-greeting { animation-delay: 0.1s; }
.dash--intro .dash-name { animation-delay: 0.45s; }
.dash--intro .dash-subtitle { animation-delay: 0.8s; }
.dash--intro .dash-section-title { animation-delay: 1.05s; }

/* The cards come in one after the other */
.dash--intro .action-card:nth-child(1) { animation-delay: 1.2s; }
.dash--intro .action-card:nth-child(2) { animation-delay: 1.32s; }
.dash--intro .action-card:nth-child(3) { animation-delay: 1.44s; }
.dash--intro .action-card:nth-child(4) { animation-delay: 1.56s; }

/* The divider line under the greeting draws itself from left to right */
.dash-hero {
    position: relative;
    border-bottom-color: transparent;
}

    .dash-hero::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 1px;
        background: var(--dash-line, rgba(15, 23, 42, 0.08));
        transform-origin: left;
    }

.dash--intro .dash-hero::after {
    animation: dash-line 0.8s ease-out 0.85s backwards;
}

/* People who asked the system for less motion see everything at once */
@media (prefers-reduced-motion: reduce) {
    .dash-greeting,
    .dash-name,
    .dash-subtitle,
    .dash-section-title,
    .dash .action-card,
    .dash-hero::after {
        animation: none;
    }
}


/* =====================================================================
   39b. WELCOME SCREEN (Index, only right after signing in)
   ---------------------------------------------------------------------
   The greeting fills the screen for a moment and then the page goes to the
   dashboard of the role; the dashboard cards come in with .dash--ready.
   ===================================================================== */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

    .welcome-screen .welcome-content {
        width: 100%;
        max-width: 760px;
        padding-bottom: 0;
        text-align: center;
    }

    .welcome-screen .dash-hero {
        justify-content: center;
        margin-bottom: 0;
    }

    .welcome-screen .dash-title {
        font-size: clamp(1.9rem, 4vw, 2.8rem);
    }

    .welcome-screen .dash-subtitle {
        font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    }

    .welcome-screen.is-leaving {
        opacity: 0;
        transform: translateY(-14px);
    }

/* Dashboard after the greeting: the menu and the cards come in one after the other */
.dash--ready .dash-section-title,
.dash--ready .action-card {
    animation: dash-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.dash--ready .action-card:nth-child(1) { animation-delay: 0.08s; }
.dash--ready .action-card:nth-child(2) { animation-delay: 0.16s; }
.dash--ready .action-card:nth-child(3) { animation-delay: 0.24s; }
.dash--ready .action-card:nth-child(4) { animation-delay: 0.32s; }
.dash--ready .action-card:nth-child(5) { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
    .welcome-screen,
    .dash--ready .dash-section-title,
    .dash--ready .action-card {
        animation: none;
        transition: none;
    }
}


/* =====================================================================
   40. DOCUMENT MODE OF THE RICH TEXT EDITOR
   ---------------------------------------------------------------------
   The form shows a small text box (.rich-doc-field); a click opens the sheet (.rich-doc) at full screen, like a
   Word page: dark bar on top, toolbar, grey "desk" and a white A4 page with the font and margins of the PDF.
   ===================================================================== */

/* --- Box in the form: looks like a text field (a few lines), a click opens the sheet --- */
.rich-doc-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
    padding: 14px 16px 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .rich-doc-field:hover {
        border-color: #93a3b8;
    }

    .rich-doc-field:focus-visible {
        outline: none;
        border-color: var(--accent, #22d3ee);
        box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
    }

.rich-doc-preview {
    display: -webkit-box;
    flex: 1;
    margin: 0;
    overflow: hidden;
    color: #111827 !important;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-line;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

    .rich-doc-preview.is-empty {
        color: #94a3b8 !important;
    }

.rich-doc-field-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #eef1f5;
    color: #64748b;
    font-size: 0.78rem;
}

.rich-doc-field-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-weight: 600;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.rich-doc-field:hover .rich-doc-field-hint,
.rich-doc-field:focus-visible .rich-doc-field-hint {
    opacity: 1;
}

/* Draft found in the browser */
.rich-doc-draft {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    font-size: 0.88rem;
}

    .rich-doc-draft[hidden] {
        display: none;
    }

/* --- The sheet at full screen --- */
html.rich-doc-open,
html.rich-doc-open body {
    overflow: hidden;   /* only the sheet scrolls */
}

.rich-doc {
    position: fixed;
    inset: 0;
    z-index: 2000;      /* over the top bar and the side menu */
    display: flex;
    flex-direction: column;
    background: #e5e9f0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

    .rich-doc[hidden] {
        display: none;
    }

    .rich-doc.is-open {
        opacity: 1;
        transform: none;
    }

.rich-doc-bar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    background: #0e1730;
    color: #fff;
    box-shadow: 0 2px 10px rgba(2, 6, 23, 0.35);
}

.rich-doc-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.rich-doc-saved {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.8rem;
}

.rich-doc-done {
    padding-inline: 18px;
}

.rich-doc .rich-doc-toolbar {
    flex-shrink: 0;
    justify-content: center;
    margin: 0 !important;
    padding: 8px 20px;
    border-bottom: 1px solid #d5dbe5;
    background: #fff;
}

.rich-doc-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px 16px 64px;
}

/* The page: A4 width, margins and font of the PDF (Courier New 12, line height 1.5, justified) */
.rich-doc .rich-doc-page {
    width: min(21cm, 100%);
    max-width: none;
    min-height: 29.7cm;
    margin: 0 auto;
    padding: 3cm 2cm 2.5cm 3.3cm !important;
    border: 1px solid #d1d5db !important;
    border-radius: 2px !important;
    background: #fff !important;
    color: #000 !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12pt;
    line-height: 1.5;
    text-align: justify;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 18px 40px -20px rgba(15, 23, 42, 0.45) !important;
}

    .rich-doc .rich-doc-page:focus {
        border-color: #c7cfdb !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 18px 40px -20px rgba(15, 23, 42, 0.45) !important;
    }

    /* Paragraphs, lists and bold keep the black of the page (the dark theme greys out "p") */
    .rich-doc .rich-doc-page * {
        color: inherit !important;
    }

/* AI panel and other companions, under the page */
.rich-doc-companions {
    width: min(21cm, 100%);
    margin: 24px auto 0;
}

    .rich-doc-companions:empty {
        display: none;
    }

/* Phones: the page uses the whole width */
@media (max-width: 767.98px) {
    .rich-doc-scroll {
        padding: 0;
    }

    .rich-doc .rich-doc-page {
        min-height: 100%;
        padding: 24px 18px !important;
        border: 0 !important;
        box-shadow: none !important;
        text-align: left;
    }

    .rich-doc-saved {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rich-doc {
        transition: none;
    }
}
