/* ==========================================================================
   ARXGeo360 — Global Styles
   Reset, tipografia base, navbar, botões, formulários, modais,
   toast notifications, utilities.
   Carregado em todas as páginas via base.html.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--arx-cloud);
    background-color: var(--arx-black);
    overflow: hidden;
    height: 100vh;
}

a {
    color: var(--arx-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--arx-accent-light);
}

::selection {
    background: var(--arx-accent);
    color: var(--arx-on-accent);
}

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--arx-graphite); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--arx-slate); }

/* ── Typography ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--arx-white);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

.text-mono   { font-family: var(--font-mono); font-size: var(--fs-sm); }

/* Lucide icon sizes (lucide keeps these classes on the generated <svg>).
   !important so they win over container rules, as the inline sizes did. */
.icon-xs { width: 12px !important; height: 12px !important; }
.icon-sm { width: 14px !important; height: 14px !important; }
.icon-md { width: 16px !important; height: 16px !important; }
.icon-lg { width: 18px !important; height: 18px !important; }

/* ── Navbar ───────────────────────────────────────────────────────────── */

.arx-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-h);
    background: var(--arx-dark);
    border-bottom: var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-4);
    z-index: var(--z-navbar);
    gap: var(--sp-4);
    backdrop-filter: blur(12px);
}

.arx-navbar__brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    flex-shrink: 0;
}

.arx-navbar__logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: filter var(--duration-fast) var(--ease-out);
}

.arx-navbar__brand:hover .arx-navbar__logo {
    filter: brightness(0) invert(1) drop-shadow(0 0 6px var(--arx-accent));
}

.arx-navbar__title {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--arx-white);
    letter-spacing: var(--ls-tight);
}

.arx-navbar__title span {
    color: var(--arx-accent);
    font-weight: var(--fw-bold);
}

.arx-navbar__spacer { flex: 1; }

.arx-navbar__project {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    background: var(--arx-charcoal);
    border: var(--border-light);
    border-radius: var(--radius-md);
    color: var(--arx-mist);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    text-decoration: none;
}

.arx-navbar__project:hover {
    background: var(--arx-graphite);
    color: var(--arx-white);
}

.arx-navbar__project i {
    color: var(--arx-accent);
    font-size: var(--fs-sm);
}

/* Breadcrumb "Organização / Projeto" (templates/maps/viewer.html) */
.arx-navbar__org {
    color: var(--arx-ash);
    font-weight: var(--fw-regular);
}

.arx-navbar__crumb-sep {
    color: var(--arx-slate);
}

.arx-navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.arx-navbar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--arx-silver);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    font-size: var(--fs-md);
}

.arx-navbar__btn:hover {
    background: var(--arx-charcoal);
    color: var(--arx-white);
}

.arx-navbar__user {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    background: transparent;
    border: var(--border-light);
    border-radius: var(--radius-full);
    color: var(--arx-mist);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.arx-navbar__user:hover {
    background: var(--arx-charcoal);
    color: var(--arx-white);
}

.arx-navbar__avatar {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--arx-accent);
    color: var(--arx-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn-arx {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    transition: all var(--duration-fast) var(--ease-out);
    line-height: 1;
}

.btn-arx-primary {
    background: var(--arx-accent);
    color: var(--arx-on-accent);
}

.btn-arx-primary:hover {
    background: var(--arx-accent-light);
    box-shadow: var(--shadow-glow);
}

.btn-arx-ghost {
    background: transparent;
    color: var(--arx-silver);
    border: var(--border-light);
}

.btn-arx-ghost:hover {
    background: var(--arx-charcoal);
    color: var(--arx-white);
}

.btn-arx-danger {
    background: var(--arx-danger);
    color: var(--arx-white);
}

.btn-arx-danger:hover {
    background: var(--arx-danger-dim);
}

.btn-arx-sm {
    font-size: var(--fs-xs);
    padding: var(--sp-1) var(--sp-3);
}

.btn-arx:disabled,
.btn-arx[aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none !important;
    pointer-events: none;
}

/* ── Form Inputs ──────────────────────────────────────────────────────── */

.arx-input {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    color: var(--arx-cloud);
    background: var(--arx-charcoal);
    border: 1px solid var(--arx-graphite);
    border-radius: var(--radius-md);
    padding: var(--sp-2) var(--sp-3);
    width: 100%;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.arx-input:focus {
    border-color: var(--arx-focus);
    box-shadow: 0 0 0 3px var(--arx-focus-ring);
}

.arx-input::placeholder {
    color: var(--arx-slate);
}

.arx-label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--arx-ash);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--sp-1);
}

.arx-form-group {
    margin-bottom: var(--sp-3);
}

textarea.arx-input  { resize: vertical; min-height: 60px; }
select.arx-input    { cursor: pointer; }

/* ── Modals ───────────────────────────────────────────────────────────── */

.arx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    box-sizing: border-box;
    overflow: auto;
    animation: arx-fade-in 0.2s ease;
}

@keyframes arx-fade-in { from { opacity: 0; } to { opacity: 1; } }

.arx-modal {
    background: var(--arx-dark);
    border: var(--border-light);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 460px;
    max-height: min(92vh, 980px);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: arx-modal-in 0.3s var(--ease-out);
}

.arx-modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.arx-modal--wide {
    width: min(96vw, 1040px);
    max-width: 1040px;
}

.arx-modal--editor {
    width: min(96vw, 860px);
    max-width: 860px;
}

.arx-modal--danger {
    max-width: 520px;
    border-color: color-mix(in srgb, var(--arx-danger) 42%, rgba(255, 255, 255, 0.14));
}

.arx-modal--wide .arx-modal__footer {
    flex-wrap: wrap;
}

@keyframes arx-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.arx-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: var(--border-subtle);
}

.arx-modal__header h3 { font-size: var(--fs-md); }

.arx-modal__body {
    padding: var(--sp-5);
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.arx-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-top: var(--border-subtle);
    flex-shrink: 0;
}

.danger-confirm__heading {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.danger-confirm__icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--arx-danger);
    background: color-mix(in srgb, var(--arx-danger) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--arx-danger) 32%, transparent);
    flex-shrink: 0;
}

.danger-confirm__message {
    color: var(--arx-cloud);
    font-size: var(--fs-md);
    line-height: 1.45;
    margin: 0;
}

.danger-confirm__detail {
    color: var(--arx-ash);
    font-size: var(--fs-sm);
    line-height: 1.55;
    margin: var(--sp-3) 0 0;
}

.danger-confirm__status {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    padding: var(--sp-3);
    border-radius: var(--radius-md);
    color: var(--arx-cloud);
    font-size: var(--fs-sm);
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-subtle);
}

.danger-confirm__spinner {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid color-mix(in srgb, var(--arx-danger) 28%, transparent);
    border-top-color: var(--arx-danger);
    animation: arx-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.arx-modal--danger.is-busy .modal-close-btn {
    opacity: 0.42;
    pointer-events: none;
}

/* ── Toast / Notifications ────────────────────────────────────────────── */

.arx-toast-container {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.arx-toast {
    --toast-accent: var(--arx-cloud);
    padding: 10px 14px;
    background: rgba(18, 22, 30, 0.94);
    border: none;
    border-radius: var(--radius-md);
    color: var(--arx-cloud);
    font-size: var(--fs-sm);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: arx-toast-in var(--duration-normal) var(--ease-out);
    max-width: 360px;
}

.arx-toast svg {
    color: var(--toast-accent);
}

.arx-toast--success { --toast-accent: var(--arx-success); }
.arx-toast--error   { --toast-accent: var(--arx-danger); }
.arx-toast--info    { --toast-accent: var(--arx-info); }
.arx-toast--warning { --toast-accent: var(--arx-warning); }

@keyframes arx-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Shared animations ────────────────────────────────────────────────── */

/* Spinner rotation, used by every loading icon (app.css loads on all pages). */
@keyframes arx-spin { to { transform: rotate(360deg); } }

/* ── Membros de um projeto (static/js/project-members.js: painel da org e mapa) ── */

.members-add {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.members-table th {
    text-align: left;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--arx-ash);
    padding: var(--sp-2);
}

.members-table td {
    padding: var(--sp-2);
    border-top: var(--border-subtle);
    vertical-align: middle;
}

.members-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.members-cell span {
    color: var(--arx-ash);
    font-size: var(--fs-xs);
}

.members-badge--muted {
    align-self: flex-start;
    padding: 0 var(--sp-2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
}

.members-role {
    min-width: 160px;
}

.members-actions {
    text-align: right;
}

.members-remove {
    border: 0;
    background: transparent;
    color: var(--arx-ash);
    cursor: pointer;
    padding: var(--sp-1);
    border-radius: var(--radius-sm);
}

.members-remove:hover {
    color: var(--arx-danger);
    background: rgba(231, 76, 60, 0.12);
}

.members-empty {
    color: var(--arx-ash);
    text-align: center;
}
