/**
 * Luneon - Componentes comuns (toasts, modais, etc.)
 */

/* ── Toast Notifications ──────────────────────────────────── */

#psi-toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 2rem);
}

.psi-toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    line-height: 1.4;
    pointer-events: auto;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.psi-toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.psi-toast--out {
    transform: translateX(110%);
    opacity: 0;
}

.psi-toast--success {
    background: #1a3a2a;
    border: 1px solid #2d6b4a;
    color: #7ee8a8;
}

.psi-toast--error {
    background: #3a1a1a;
    border: 1px solid #8b3a3a;
    color: #f0a0a0;
}

.psi-toast--info {
    background: #1a2a3a;
    border: 1px solid #3a5a8b;
    color: #a0c8f0;
}

.psi-toast--warning {
    background: #3a3018;
    border: 1px solid #8b7a3a;
    color: #f0d8a0;
}

.psi-toast__icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    line-height: 1;
}

.psi-toast__msg {
    flex: 1;
    word-break: break-word;
}

.psi-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.25rem;
    line-height: 1;
    transition: opacity 0.2s;
}

.psi-toast__close:hover {
    opacity: 1;
}

/* ── Confirm Dialog ───────────────────────────────────────── */

.psi-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(25, 27, 42, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: psi-fade-in 0.2s ease;
}

.psi-confirm-box {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, rgba(248, 247, 245, 0.08));
    border-radius: var(--radius, 12px);
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.psi-confirm-box__msg {
    font-size: 0.9375rem;
    color: var(--text, #ffffff);
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

.psi-confirm-box__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

@keyframes psi-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Empty State ──────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted, #bfbfbf);
    font-size: 0.9375rem;
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ── Barra de busca e filtros (layout padrão: fundo escuro + borda dourada) ── */

.search-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-filters-bar .search-input,
.search-filters-bar .filter-select,
.search-filters-bar input[type="text"],
.search-filters-bar input[type="date"],
.search-filters-bar input[type="number"],
.search-filters-bar select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-gold-border, rgba(201, 162, 74, 0.45));
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card, #1a1a1a);
    color: var(--text, #ffffff);
    font-family: var(--font, 'DM Sans', sans-serif);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-filters-bar .search-input:focus,
.search-filters-bar .filter-select:focus,
.search-filters-bar input:focus,
.search-filters-bar select:focus {
    outline: none;
    border-color: var(--accent-light, #e0b95c);
    box-shadow: 0 0 0 2px rgba(224, 185, 92, 0.15);
}

.search-filters-bar .search-input::placeholder,
.search-filters-bar input::placeholder {
    color: var(--text-muted, #bfbfbf);
}

.search-filters-bar .filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text, #ffffff);
    margin-right: 0.25rem;
}

.search-filters-bar .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-filters-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-filters-bar .filter-select {
    min-width: 120px;
}

/* ── Skeleton Loader ──────────────────────────────────────── */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card, #1a1a1a) 25%,
        rgba(248, 247, 245, 0.06) 50%,
        var(--bg-card, #1a1a1a) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm, 8px);
}

.skeleton--text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton--card {
    height: 120px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton--list-item {
    height: 2.5rem;
    margin-bottom: 0.5rem;
}

.skeleton--progress-card {
    height: 90px;
    min-width: 160px;
    flex: 1;
}

/* ── Fade-in Animation ───────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card Hover Effect ───────────────────────────────────── */

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Tab Transition ──────────────────────────────────────── */

.tab-content {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-content--entering {
    opacity: 0;
    transform: translateY(4px);
}

/* ── Top Progress Bar (YouTube/GitHub style) ─────────────── */

#psi-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent, #c9a24a);
    z-index: 10002;
    pointer-events: none;
    transition: width 0.3s ease, opacity 0.2s ease;
    box-shadow: 0 0 8px var(--accent, #c9a24a);
    opacity: 0;
}

#psi-progress-bar.active {
    opacity: 1;
    animation: progressPulse 1.8s ease infinite;
}

@keyframes progressPulse {
    0%   { width: 15%; }
    50%  { width: 70%; }
    100% { width: 85%; }
}

/* ── Modal (trilhas, disciplinas, cultural) ───────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-card {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--color-gold-border, rgba(201, 162, 74, 0.45));
    border-radius: var(--radius, 8px);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}
/* Formulário em modal: sempre full width dentro do container */
.modal-card form,
.modal-card .form-group {
    width: 100%;
    box-sizing: border-box;
}
.modal-card input,
.modal-card select,
.modal-card textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.modal-title { margin: 0 0 1rem; font-size: 1.25rem; color: var(--accent-light, #e0b95c); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.875rem; color: var(--text-muted, #bfbfbf); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }
.btn-secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--color-gold-border-soft); }
.btn-secondary:hover { background: rgba(201, 162, 74, 0.1); color: var(--accent-light); }

.track-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-track-edit, .btn-track-delete {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--color-gold-border-soft);
    background: transparent;
    color: var(--accent-light);
    cursor: pointer;
    font-family: inherit;
}
.btn-track-edit:hover, .btn-track-delete:hover { background: rgba(201, 162, 74, 0.15); }
.btn-track-delete { color: #e07a7a; border-color: rgba(224, 122, 122, 0.4); }
.btn-track-delete:hover { background: rgba(224, 122, 122, 0.1); }
.badge-personal { font-size: 0.6875rem; padding: 0.15rem 0.4rem; background: rgba(201, 162, 74, 0.2); color: var(--accent-light); border-radius: 4px; margin-left: 0.35rem; }
.discipline-actions, .cultural-card-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-edit, .btn-delete { font-size: 0.8125rem; padding: 0.25rem 0.5rem; border-radius: 4px; border: 1px solid var(--color-gold-border-soft); background: transparent; color: var(--accent-light); cursor: pointer; }
.btn-delete { color: #e07a7a; border-color: rgba(224, 122, 122, 0.4); }
.btn-edit:hover, .btn-delete:hover { background: rgba(201, 162, 74, 0.15); }
.btn-delete:hover { background: rgba(224, 122, 122, 0.1); }
.discipline-card-wrap { position: relative; }
.discipline-card-wrap .discipline-actions { position: absolute; bottom: 0.5rem; right: 0.5rem; }

/* Campos com máscara (assets/js/input-masks.js — data-mask) */
input[data-mask],
textarea[data-mask] {
    font-variant-numeric: tabular-nums;
}
