/* --- Toast Notification System --- */
/* Toast Notification Styling */
.toast-card {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 100px);
    /* Initially positioned below viewport using transform */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 30px rgba(31, 38, 135, 0.12);
    border-radius: 12px;
    padding: 12px 24px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(calc(100vw - 32px), 480px);
    width: max-content;
}

.toast-card.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

/* Top Position Modifier (Mobile Fallback / Viewport Top) */
.toast-card.toast-top {
    bottom: auto;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -100px);
}

.toast-card.toast-top.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

/* Contextual Anchored Top (Floats directly above target element) */
.toast-card.toast-anchored-top {
    bottom: auto;
    transform: translate(-50%, -85%) scale(0.96);
}

.toast-card.toast-anchored-top.show {
    transform: translate(-50%, -100%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Contextual Anchored Bottom (Floats directly below target element) */
.toast-card.toast-anchored-bottom {
    bottom: auto;
    transform: translate(-50%, -12px) scale(0.96);
}

.toast-card.toast-anchored-bottom.show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Polymorphic Toast Variants */
.toast-card.toast-error {
    border-color: rgba(220, 75, 75, 0.7);
    background: rgba(255, 245, 245, 0.90);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.15);
}

.toast-card.toast-info {
    border-color: rgba(72, 123, 195, 0.6);
    background: rgba(240, 246, 255, 0.90);
    box-shadow: 0 10px 30px rgba(72, 123, 195, 0.12);
}

/* Dark Theme Overrides for Toast Variants */
html[data-theme="dark-grey"] .toast-card {
    background: rgba(30, 32, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark-grey"] .toast-card.toast-error {
    background: rgba(45, 25, 30, 0.92);
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.25);
}
html[data-theme="dark-grey"] .toast-card.toast-info {
    background: rgba(25, 35, 48, 0.92);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

/* Toast SVG Icon Styling */
.toast-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    display: block;
}

.toast-icon.toast-icon-success,
.toast-check {
    color: var(--color-grid);
    flex-shrink: 0;
}

.toast-icon.toast-icon-error {
    color: #DC3838;
}

.toast-icon.toast-icon-info {
    color: var(--color-cta);
}

@media (max-width: 1260px) {
    .qualifications-columns {
        flex-direction: column;
        gap: 20px;
    }

    .logo-horizontal-row {
        gap: 16px;
    }

    .detail-split-container {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .detail-logo-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-grid);
        padding-left: 0;
        padding-top: 16px;
        height: auto;
        align-items: flex-start;
    }

    .logo-sidebar-title {
        margin-bottom: 12px;
    }

    .logo-vertical-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px 24px;
        justify-content: flex-start;
    }

    .ai-box-form {
        flex-direction: column;
    }

    .ai-form-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    #ai-query-submit {
        flex-grow: 1;
        width: auto;
    }

    .char-counter {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .ai-box-container {
        padding: 16px;
    }

    .ai-box-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

@media (max-width: 767px) {
    .headline {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .body-text {
        font-size: 11px;
    }

    .text-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ai-box-container {
        padding: 12px;
    }

    .ai-box-title {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .detail-container {
        padding: 18px 18px;
        gap: 14px;
    }

    /* iOS auto-zooms inputs with font-size < 16px, which changes
       window.innerWidth and causes the grid to shift left. Setting
       16px on mobile prevents this zoom entirely. */
    #ai-query-input {
        font-size: 16px;
    }
}

/* Reduced Motion (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    .toast-card {
        transform: translate(-50%, 0) !important;
        transition: opacity 0.2s ease, visibility 0.2s !important;
    }
    .toast-card.toast-anchored-top {
        transform: translate(-50%, -100%) !important;
    }
}
