﻿/* Global Settings */
html, body {
    font-family: 'Assistant', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F0F1F6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    direction: rtl;
    color: #2c3e50;
}

/* Course-wide subtle background image (15% opacity over page color) */
body {
    isolation: isolate;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('./css/Images/BG.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
}

html:has(body.welcome-page),
body.welcome-page {
    height: 100%;
    overflow: hidden;
}

#app:has(.welcome-container) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: clamp(10px, 1.6vh, 20px);
    box-sizing: border-box;
    overflow: hidden;
}

/* Main Welcome Container - fills viewport, no page scroll */
.welcome-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: min(1180px, calc(100vw - 2 * clamp(10px, 1.6vh, 20px)));
    height: min(720px, calc(100dvh - 2 * clamp(10px, 1.6vh, 20px)));
    max-height: calc(100dvh - 2 * clamp(10px, 1.6vh, 20px));
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.welcome-container .row {
    height: 100%;
    min-height: 0;
}

/* Image Column */
.image-column {
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.welcome-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Purple Panel */
.purple-panel {
    background-color: #320F5B;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    position: relative;
    height: 100%;
    min-height: 0;
}

.purple-content {
    padding: clamp(1.15rem, 2.8vh, 2rem) clamp(1.6rem, 3.2vw, 2.85rem);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: right;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.welcome-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: clamp(0.7rem, 1.7vh, 1.2rem);
    width: 100%;
    max-width: min(680px, 100%);
    height: 100%;
    min-height: 0;
    text-align: right;
    padding-top: clamp(2.4rem, 5.5vh, 3.4rem);
    padding-inline: 0;
    box-sizing: border-box;
}

.welcome-highlights-title {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(1.2rem, 2.5vh, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0;
    align-self: stretch;
    text-align: right;
    line-height: 1.4;
}

.welcome-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(0.55rem, 1.35vh, 0.95rem);
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: clamp(0.6rem, 1.2vw, 0.85rem);
    text-align: right;
    padding: 0;
    background: none;
}

.highlight-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FEC600;
    width: clamp(1.4rem, 2.6vh, 1.75rem);
    height: clamp(1.4rem, 2.6vh, 1.75rem);
}

.highlight-icon svg {
    width: 100%;
    height: 100%;
}

.highlight-text {
    color: #ffffff;
    font-size: clamp(1.18rem, 2.55vh, 1.45rem);
    line-height: 1.4;
}

.highlight-text strong {
    font-weight: 700;
}

.welcome-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(max-content, 1fr));
    column-gap: clamp(0.85rem, 1.8vw, 1.5rem);
    row-gap: 0;
    width: 100%;
    padding: clamp(0.8rem, 1.7vh, 1.15rem) clamp(1rem, 1.8vw, 1.4rem);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-sizing: border-box;
}

.meta-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: right;
    min-width: max-content;
}

.meta-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(0.85rem, 1.65vh, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    width: auto;
    text-align: right;
    white-space: nowrap;
}

.meta-value {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(0.98rem, 2vh, 1.2rem);
    font-weight: 500;
    line-height: 1.3;
    width: auto;
    white-space: nowrap;
}

/* ON CALL Badge - top-right corner of purple panel */
.on-call-badge {
    position: absolute;
    top: clamp(1rem, 2.4vh, 1.6rem);
    inset-inline-start: clamp(1.6rem, 3.2vw, 2.85rem);
    inset-inline-end: auto;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: clamp(0.4rem, 0.95vh, 0.6rem) clamp(0.85rem, 1.5vw, 1.15rem);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    width: fit-content;
    margin: 0;
}

.status-dot {
    width: clamp(9px, 1.3vh, 12px);
    height: clamp(9px, 1.3vh, 12px);
    background-color: #4ade80;
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

.badge-text {
    color: #ffffff;
    font-size: clamp(0.82rem, 1.6vh, 1rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Main Headline */
.main-headline {
    color: #FEC600;
    font-family: 'Assistant', sans-serif;
    font-weight: 800;
    font-size: clamp(1.15rem, 1.7vw + 0.35rem, 1.75rem);
    line-height: 1.25;
    margin: clamp(0.55rem, 1.6vh, 1.1rem) 0 0;
    letter-spacing: -0.02em;
    text-align: right;
    align-self: stretch;
    white-space: nowrap;
    overflow: visible;
    max-width: 100%;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 100%;
    justify-content: stretch;
}

/* Action Buttons */
.action-btn {
    font-family: 'Assistant', sans-serif;
    background-color: #FEC600;
    color: #320F5B;
    padding: clamp(0.9rem, 1.85vh, 1.2rem) 1.25rem;
    font-size: clamp(1.22rem, 2.5vh, 1.5rem);
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: center;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(254, 198, 0, 0.3);
}

.action-btn:hover {
    background-color: #ffd633;
    color: #320F5B;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 198, 0, 0.4);
    text-decoration: none;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(254, 198, 0, 0.3);
}

/* Responsive - stacked layout still fits viewport without page scroll */
@media (max-width: 991.98px) {
    #app:has(.welcome-container) {
        height: 100dvh;
        overflow: hidden;
    }

    .welcome-container {
        height: min(720px, calc(100dvh - 2 * clamp(10px, 1.6vh, 20px)));
        max-height: calc(100dvh - 2 * clamp(10px, 1.6vh, 20px));
    }

    .welcome-container .row {
        flex-wrap: nowrap;
        flex-direction: column;
        height: 100%;
    }

    .welcome-container .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .image-column {
        flex: 0 0 32%;
        min-height: 0;
        height: auto;
        max-height: 32%;
    }

    .purple-panel {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    .purple-content {
        padding: clamp(0.9rem, 2.2vh, 1.6rem) clamp(1.1rem, 3vw, 1.75rem);
        justify-content: flex-start;
        overflow: hidden;
    }

    .welcome-inner {
        max-width: min(680px, 100%);
        gap: clamp(0.4rem, 1.1vh, 0.8rem);
        flex: 1 1 auto;
        min-height: 0;
        justify-content: space-between;
        padding-top: clamp(2.1rem, 5vh, 2.8rem);
        align-items: stretch;
        text-align: right;
    }

    .main-headline {
        font-size: clamp(0.95rem, 2.8vw, 1.35rem);
        white-space: nowrap;
    }

    .welcome-meta {
        grid-template-columns: 1fr;
        gap: clamp(0.35rem, 0.9vh, 0.6rem);
        padding: clamp(0.55rem, 1.2vh, 0.85rem) 0.9rem;
    }

    .meta-group {
        min-width: 0;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.15rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .meta-group:last-child {
        border-bottom: none;
    }

    .meta-label,
    .meta-value {
        text-align: right;
        width: auto;
        white-space: nowrap;
    }

    .button-group {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .welcome-container {
        border-radius: 12px;
    }

    .image-column {
        flex-basis: 28%;
        max-height: 28%;
    }

    .on-call-badge {
        padding: 0.4rem 0.8rem;
    }

    .highlight-text {
        font-size: clamp(1rem, 2.15vh, 1.22rem);
    }

    .action-btn {
        font-size: clamp(1.08rem, 2.25vh, 1.28rem);
    }
}

/* Hide Blazor Error UI */
#blazor-error-ui {
    display: none;
}

/* Bootstrap modal bridge for legacy popups.
   Popups use Bootstrap's modal structure (modal > modal-dialog > modal-content)
   and the bootstrap.Modal JS plugin, while each popup's original overlay/box
   classes keep painting the exact same design:
   - the legacy overlay element IS the .modal, so its own dimmed background
     is preserved (Bootstrap's injected backdrop is disabled per-popup with
     data-bs-backdrop="false");
   - .modal-dialog / .modal-content are display:contents so Bootstrap's default
     dialog box, sizing and borders paint nothing — the legacy box inside is
     rendered exactly as before. */
.modal.legacy-modal-overlay {
    display: none;
}

.modal.legacy-modal-overlay.show {
    display: flex !important;
}

.modal.legacy-modal-overlay .modal-dialog,
.modal.legacy-modal-overlay .modal-content {
    display: contents;
}
