/* app/static/css/base_client.css */

/* ===============================
   BASE CLIENT ADMIN — ESTRUTURAL
   =============================== */

/* ---------- Tema / Variáveis ---------- */
:root {
    --primary-color: #779f0afb;
    --primary-hover: #5f7e07fb;

    --error-color: #c82333;
    --error-color-hover: #dc3545;

    --cancel-color: #6c757d;
    --cancel-color-hover: #5a6268;

    --text-color: #333;
    --background-color: #f8f9fa;

    --success-color: #28a745;

    --spinner-color: #779f0afb;
    --spinner-background: #f3f3f3;

    --header-height: 60px;
}

/* ---------- Base / Tipografia ---------- */
body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: 18px;
    padding-top: var(--header-height);
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p {
    font-size: 16px;
    line-height: 1.5;
}

@media (min-width: 1200px) {
    body { font-size: 19px; }
}

/* ---------- Header ---------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: var(--header-height);
    background-color: var(--primary-color);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1200;
    border-bottom: 1px solid rgba(255,255,255,0.25);
}

header h1 {
    margin: 0;
    font-size: 24px;
}

.current-lang {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.9;
}

/* ---------- Layout ---------- */
/* .container {
    max-width: 1200px;
    margin-left: 0;
    padding: 20px;
} */

.container{
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
}

.content.shifted {
    margin-top: 0;
}

/* ---------- Sidebar / Menu ---------- */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;

    width: 250px;
    height: calc(100vh - var(--header-height));

    background-color: var(--primary-color);
    border-right: 1px solid #ddd;
    z-index: 1000;
}

.sidebar ul {
    list-style: none;
    padding: 16px 20px 20px;
    margin: 0;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    display: block;
    padding: 10px;
    color: white;
    text-decoration: none;
}

.sidebar ul li a.active,
.sidebar ul li a:hover {
    background-color: var(--primary-hover);
    border-radius: 4px;
}

.toggle-btn {
    position: fixed;
    top: 60px;
    left: 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1100;
    color: var(--primary-color);
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    display: none !important;
}

.toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* ---------- Responsivo ---------- */
@media (min-width: 769px) {
    .content.shifted { margin-left: 250px; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        left: -200px;
    }

    .sidebar.active { left: 0; }

    .content.shifted { margin-left: 200px; }

    .toggle-btn { display: block !important; }
}

/* ---------- Modais ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1300;
}

.modal:not(.hidden) {
    display: flex !important;
}

.modal-content {
    background-color: white;
    padding: 26px 28px;
    border-radius: 10px;

    width: 90%;
    max-width: 520px;

    box-shadow:
        0 20px 40px rgba(0,0,0,0.18),
        0 6px 12px rgba(0,0,0,0.12);

    max-height: 85vh;

    display: flex;
    flex-direction: column;

    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modal-content h3 {
    margin: 0;
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.modal-buttons {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-buttons button {
    width: 140px;
    height: 40px;
}

/* ---------- Spinner ---------- */
.spinner {
    border: 4px solid var(--spinner-background);
    border-top: 4px solid var(--spinner-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Flash ---------- */
.flash-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.flash-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.hidden {
    display: none;
}

/* ===============================
   MODAL — SYSTEM MESSAGE (READ)
   =============================== */

/* Variante específica do modal de alerts */
.modal-alert {
    width: 90%;
    max-width: 760px;

    height: 92vh;        /* 👈 altura explícita e bem maior */
    max-height: 92vh;

    display: flex;
    flex-direction: column;
}


/* Header fixo */
.modal-alert-header {
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.modal-alert-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

/* Corpo com scroll */
/* Corpo do modal com delimitação clara */
.modal-alert-body {
    flex: 1;
    overflow: hidden;

    border: 1px solid #e0e0e0;      /* 👈 linha envoltória */
    border-radius: 4px;

    background-color: #fafafa;      /* 👈 leve contraste */
    margin: 12px 0;                 /* separa header e footer */
}

/* Iframe continua ocupando tudo */
.modal-alert-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;        /* garante fundo limpo */
    overflow: auto;
}

/* Botão Fechar */
.btn-cancel {
    background-color: var(--cancel-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    background-color: var(--cancel-color-hover);
}

.best-practices {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px 14px;
  background-color: #fafafa;
  display: block;
  width: 100%;
}


.best-practices summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.best-practices summary::-webkit-details-marker {
  display: none;
}

.best-practices ul {
  margin-top: 10px;
  padding-left: 18px;
}

.best-practices li {
  margin-bottom: 6px;
}

details.best-practices {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

details.best-practices summary {
    display: block;
    width: 100%;
}

.content.shifted {
    margin-top: 0;
}

/* ===============================
   Tooltip de ajuda (Help ?)
   =============================== */
.help-tooltip {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;

    border-radius: 50%;
    background-color: var(--cancel-color);
    color: white;

    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 18px;

    cursor: pointer;
}

.help-tooltip-text {
    position: absolute;
    top: 130%;
    left: 0;

    width: 420px;
    max-width: 80vw;

    background-color: #333;
    color: #fff;

    padding: 12px 14px;
    border-radius: 6px;

    font-size: 13px;
    line-height: 1.5;
    text-align: left;

    box-shadow: 0 4px 12px rgba(0,0,0,0.25);

    display: none;
    z-index: 2000;
}

.help-tooltip:hover .help-tooltip-text {
    display: block;
}

.help-tooltip-text::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 14px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

/* ===============================
   BUTTON SYSTEM — CLIENT ADMIN
   =============================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 22px;
    min-width: 140px;
    height: 40px;

    border-radius: 6px;
    border: none;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    text-decoration: none !important;

    transition: background-color 0.15s ease,
                transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

/* PRIMARY */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* SECONDARY */
.btn-secondary {
    background-color: var(--cancel-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--cancel-color-hover);
}

/* DANGER */
.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--error-color-hover);
}

/* ===============================
   Mobile adjustments — Buttons
   =============================== */

@media (max-width: 480px) {

    .contexts-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .contexts-actions .btn {
        width: 100%;
        min-width: unset; /* 🔥 remove limite mínimo */
    }

}