/* ============================================================
   GAME SERVER PANEL – modals.css
   ============================================================ */

/* ── Overlay ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal Box ─────────────────────────────────────────────── */
.modal {
    background: var(--bg-card);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal.modal-terminal {
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* ── Modal Header ──────────────────────────────────────────── */
.modal-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.modal-title {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title .title-icon { font-size: 1.1rem; }

.modal-title .title-badge {
    font-family: var(--mono);
    font-size: 0.65rem;
    background: var(--red-subtle);
    border: 1px solid rgba(196,22,28,0.3);
    color: var(--red);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.1em;
}

.btn-modal-close {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-modal-close:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* ── Login Modal Body ──────────────────────────────────────── */
.modal-body { padding: 1.5rem 1.25rem; }

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--red);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 0.75rem;
    box-shadow: 0 0 24px var(--red-glow);
}

.login-logo-text {
    font-family: var(--display);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Form fields */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
    font-family: var(--mono);
}

.form-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder { color: var(--text-dim); }

.form-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-subtle);
}

.form-error {
    font-size: 0.78rem;
    color: var(--red);
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--red-subtle);
    border: 1px solid rgba(196,22,28,0.25);
    border-radius: var(--radius);
    display: none;
}

.form-error.visible { display: block; }

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 0.7rem;
    background: var(--red);
    border: 1px solid var(--red-dark);
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all var(--transition);
    margin-top: 1.25rem;
    box-shadow: 0 2px 12px var(--red-glow);
}

.btn-submit:hover {
    background: var(--red-dark);
    box-shadow: 0 4px 20px var(--red-glow);
    transform: translateY(-1px);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Terminal Modal ────────────────────────────────────────── */
.terminal-toolbar {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}

.terminal-server-name {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.terminal-server-name span { color: var(--green); }

.terminal-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh-log, .btn-clear-log {
    padding: 0.28rem 0.65rem;
    font-size: 0.72rem;
    font-family: var(--mono);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.btn-refresh-log:hover { border-color: var(--green); color: var(--green); }
.btn-clear-log:hover   { border-color: var(--red);   color: var(--red); }

.terminal-auto-refresh {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.terminal-auto-refresh input { accent-color: var(--green); cursor: pointer; }

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 300px;
    max-height: 60vh;
    position: relative;
}

.terminal-output {
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: #c8e6c9;
    background: #0d1117;
    padding: 1rem 1.25rem;
    min-height: 100%;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-output .log-error   { color: #ff7875; }
.terminal-output .log-warn    { color: #ffd666; }
.terminal-output .log-info    { color: #69c0ff; }
.terminal-output .log-success { color: #95de64; }

.terminal-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* ── Confirm Modal ─────────────────────────────────────────── */
.modal.modal-confirm { max-width: 360px; }

.confirm-body {
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.confirm-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.confirm-server {
    font-weight: 700;
    color: var(--text);
    font-family: var(--display);
    font-size: 1rem;
}

.confirm-actions {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: 0.75rem;
}

.btn-confirm-yes, .btn-confirm-no {
    flex: 1;
    padding: 0.6rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all var(--transition);
    border: 1px solid;
}

.btn-confirm-yes {
    background: var(--red);
    border-color: var(--red-dark);
    color: #fff;
}
.btn-confirm-yes:hover { background: var(--red-dark); }

.btn-confirm-no {
    background: transparent;
    border-color: var(--surface-2);
    color: var(--text-muted);
}
.btn-confirm-no:hover { background: var(--bg-elevated); color: var(--text); }

/* Notification toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    font-size: 0.83rem;
    font-family: var(--mono);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastIn 0.25s ease, toastOut 0.25s ease 2.8s forwards;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    max-width: 320px;
    pointer-events: all;
}

@keyframes toastIn  { from { opacity:0; transform: translateX(20px); } }
@keyframes toastOut { to   { opacity:0; transform: translateX(20px); } }

.toast.success {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.35);
    color: var(--green);
}
.toast.error {
    background: rgba(196,22,28,0.15);
    border-color: rgba(196,22,28,0.4);
    color: #ff7875;
}
.toast.info {
    background: rgba(100,149,237,0.12);
    border-color: rgba(100,149,237,0.3);
    color: #69c0ff;
}
