/* EHDS shared UI components — toasts, modals, buttons, empty states */

:root {
    --ehds-toast-bg: rgba(13, 11, 30, 0.95);
    --ehds-toast-border: rgba(168, 85, 247, 0.45);
    --ehds-success: #06D6A0;
    --ehds-error: #ff6b6b;
    --ehds-warning: #ffc857;
    --ehds-info: #A855F7;
}

/* ---------- Toasts ---------- */
.ehds-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: calc(100% - 2rem);
}

.ehds-toast {
    pointer-events: auto;
    min-width: 240px;
    max-width: 380px;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: var(--ehds-toast-bg);
    color: #fff;
    border: 1px solid var(--ehds-toast-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ehds-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.ehds-toast .ehds-toast-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.ehds-toast .ehds-toast-body {
    flex: 1 1 auto;
}

.ehds-toast .ehds-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.ehds-toast.is-success {
    border-color: rgba(6, 214, 160, 0.55);
}
.ehds-toast.is-success .ehds-toast-icon { color: var(--ehds-success); }

.ehds-toast.is-error {
    border-color: rgba(255, 107, 107, 0.55);
}
.ehds-toast.is-error .ehds-toast-icon { color: var(--ehds-error); }

.ehds-toast.is-warning {
    border-color: rgba(255, 200, 87, 0.55);
}
.ehds-toast.is-warning .ehds-toast-icon { color: var(--ehds-warning); }

.ehds-toast.is-info .ehds-toast-icon { color: var(--ehds-info); }

@media (max-width: 480px) {
    .ehds-toast-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    .ehds-toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

/* ---------- Modal ---------- */
.ehds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ehds-modal-backdrop.is-visible {
    display: flex;
    opacity: 1;
}

.ehds-modal {
    background: linear-gradient(135deg, rgba(26, 15, 46, 0.98) 0%, rgba(45, 27, 61, 0.98) 100%);
    color: #fff;
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    max-width: 440px;
    width: 100%;
    padding: 1.75rem;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.ehds-modal-backdrop.is-visible .ehds-modal {
    transform: translateY(0);
}

.ehds-modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.ehds-modal-body {
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.ehds-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

@media (max-width: 480px) {
    .ehds-modal {
        padding: 1.25rem;
    }
    .ehds-modal-actions {
        flex-direction: column-reverse;
    }
    .ehds-modal-actions .ehds-btn {
        width: 100%;
    }
}

/* ---------- Buttons ---------- */
.ehds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    line-height: 1;
}

.ehds-btn:hover {
    transform: translateY(-1px);
}

.ehds-btn--primary {
    background: linear-gradient(135deg, #8B4DC7 0%, #E739FF 100%);
    color: #fff;
}

.ehds-btn--secondary {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
    border-color: rgba(168, 85, 247, 0.35);
}

.ehds-btn--danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ff8b8b;
    border-color: rgba(255, 107, 107, 0.5);
}

.ehds-btn--danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.ehds-btn--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
}

.ehds-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- Empty State ---------- */
.ehds-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(168, 85, 247, 0.25);
    border-radius: 12px;
}

.ehds-empty-state h3 {
    margin: 0 0 0.5rem;
    color: #fff;
}

.ehds-empty-state p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md, 10px);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    line-height: 1.2;
    box-sizing: border-box;
}
.btn:disabled, .btn.is-disabled { opacity: 0.55; cursor: not-allowed; }
.btn:hover:not(:disabled):not(.is-disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,0.25)); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple, #8B4DC7) 0%, var(--accent-magenta, #E739FF) 100%);
    color: #fff;
}
.btn-secondary {
    background: rgba(168, 85, 247, 0.18);
    color: #fff;
    border-color: rgba(168, 85, 247, 0.5);
}
.btn-secondary:hover { background: rgba(168, 85, 247, 0.3); }
.btn-ghost { background: transparent; color: var(--text-light, #fff); border-color: rgba(255,255,255,0.2); }
.btn-danger {
    background: rgba(244, 67, 54, 0.18);
    color: #ff6b6b;
    border-color: rgba(244, 67, 54, 0.45);
}
.btn-danger:hover { background: rgba(244, 67, 54, 0.3); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface-2, rgba(139, 77, 199, 0.08));
    border: 1px solid rgba(139, 77, 199, 0.25);
    border-radius: var(--radius-lg, 16px);
    padding: 1.25rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.card-header h2, .card-header h3 { margin: 0; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill, 999px);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(168, 85, 247, 0.2);
    color: #d6b8ff;
}
.badge-success { background: rgba(6, 214, 160, 0.2); color: #6ed677; }
.badge-warning { background: rgba(255, 193, 7, 0.2); color: #ffd34a; }
.badge-error   { background: rgba(244, 67, 54, 0.2); color: #ff6b6b; }
.badge-info    { background: rgba(33, 150, 243, 0.2); color: #6cb9ff; }
.badge-muted   { background: rgba(255, 255, 255, 0.1); color: rgba(255,255,255,0.65); }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1px dashed rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-lg, 16px);
    background: rgba(13, 11, 30, 0.3);
}
.empty-state-title { color: #fff; margin: 0 0 0.5rem 0; font-size: 1.2rem; }
.empty-state-message { color: var(--text-muted, rgba(255,255,255,0.65)); margin: 0 0 1.25rem 0; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.pagination-link {
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md, 10px);
    background: rgba(168, 85, 247, 0.18);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid rgba(168, 85, 247, 0.4);
    transition: background 0.2s ease;
}
.pagination-link:hover { background: rgba(168, 85, 247, 0.35); }
.pagination-link.is-disabled { opacity: 0.4; pointer-events: none; }
.pagination-info { color: var(--text-muted, rgba(255,255,255,0.7)); font-size: 0.9rem; }

/* ---------- Form fields ---------- */
.form-field { margin-bottom: 1rem; }
.form-field-label { display: block; margin-bottom: 0.4rem; color: var(--text-light, #fff); font-weight: 500; }
.form-field .form-control,
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="tel"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.95rem;
    box-sizing: border-box;
}
.form-field .form-control:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--secondary-purple, #A855F7);
    box-shadow: var(--shadow-glow, 0 0 0 3px rgba(168, 85, 247, 0.25));
}
.form-field-help { color: var(--text-muted, rgba(255,255,255,0.6)); font-size: 0.8rem; margin-top: 0.25rem; display: block; }
.form-field.has-error .form-control,
.form-field.has-error input,
.form-field.has-error textarea,
.form-field.has-error select { border-color: var(--status-error, #ff6b6b); }
.form-error { color: var(--status-error, #ff6b6b); font-size: 0.85rem; margin-top: 0.25rem; }

/* ---------- Status pill (legacy alias to badge) ---------- */
.status-badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }

/* ---------- Phase 4 L-07: Footer ---------- */
.site-footer {
    margin-top: 4rem;
    padding: 3rem 1.5rem 1.5rem;
    background: rgba(13, 11, 30, 0.85);
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    color: var(--text-muted, rgba(255,255,255,0.7));
}
.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.site-footer-col h4 { color: #fff; font-size: 1rem; margin: 0 0 0.85rem; letter-spacing: 0.5px; }
.site-footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.site-footer-col a { color: var(--text-muted, rgba(255,255,255,0.7)); text-decoration: none; transition: color 0.2s ease; }
.site-footer-col a:hover, .site-footer-col a:focus-visible { color: #fff; text-decoration: underline; }
.site-footer-meta { font-size: 0.85rem; opacity: 0.7; }
.site-footer-social { margin-top: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }
.site-footer-bottom { max-width: 1200px; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.85rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.site-footer-admin a { color: rgba(255,255,255,0.65); text-decoration: none; }
.site-footer-admin a:hover { color: var(--secondary-purple, #A855F7); text-decoration: underline; }
@media (max-width: 600px) { .site-footer-bottom { justify-content: center; text-align: center; } }

/* ---------- Phase 4 L-04: Accessibility ---------- */
*:focus-visible {
    outline: 2px solid var(--secondary-purple, #A855F7);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible, a.btn:focus-visible { outline-offset: 3px; }
button, .btn, a.menu-link, a.checkout-btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Phase 4 P-02: Loading skeletons ---------- */
.skeleton {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.08) 0%, rgba(168, 85, 247, 0.18) 50%, rgba(168, 85, 247, 0.08) 100%);
    background-size: 200% 100%;
    animation: ehds-skeleton 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm, 6px);
    color: transparent;
    user-select: none;
}
.skeleton-line { height: 0.85rem; margin: 0.4rem 0; }
.skeleton-line.lg { height: 1.4rem; }
.skeleton-card { height: 220px; border-radius: var(--radius-lg, 16px); }
@keyframes ehds-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
