/* ======================================================
   GLOBAL SHARED CSS
   File: frontend/sharedCSS/global.css
   Purpose:
   - Contains reusable base styles for organized pages
   - Do not put page-specific design here
====================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

/* ======================================================
   SHARED TOAST NOTIFICATION STYLE
   Used by toast.js on auth pages and future organized pages.
====================================================== */

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 99999;
    display: grid;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
}

.toast,
.app-toast {
    padding: 13px 16px;
    border-radius: 14px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.45;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.toast.success,
.app-toast.success {
    background: #047857;
}

.toast.error,
.app-toast.error {
    background: #dc2626;
}

.toast.info,
.app-toast.info {
    background: #0369a1;
}

@media (max-width: 600px) {
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
    }
}
/* ======================================================
   CENTERED FLOATING NOTIFICATIONS
   A toast is appended to <body> by toast.js.
   Fixed positioning keeps it OUT of flex/grid layout so
   displaying an error never shrinks the Login form.
   Applies to Login/Register and pages using showToast().
====================================================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    z-index: 100000;
    width: min(440px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    margin: 0;
    text-align: center;
    overflow-wrap: anywhere;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.toast.toast-success { background: #047857; }
.toast.toast-error   { background: #b91c1c; }
.toast.toast-info    { background: #0369a1; }

@media (max-width: 480px) {
    .toast {
        width: calc(100vw - 28px);
        max-width: 420px;
        padding: 14px 16px;
        font-size: 0.88rem;
    }
}

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