@charset "UTF-8";
/* generator-cards-v1_0.css
   Componentes reutilizaveis para geradores com selecao em cards,
   sliders de duracao e toggles (ex: /weather, /time).
   Depende das variaveis definidas em principal-v1_9.css e generator-v1_7.css. */

.section-block {
    background: var(--tutorialcolor, #1e1e1e);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    box-sizing: border-box;
    text-align: center;
}

.section-block .h2command {
    color: white;
}

.section-block > h2 {
    color: var(--color02);
    font-size: 1.1em;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

/* ── Cards de selecao ─────────────────────────────────────────────── */
.command-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.command-card {
    background-color: var(--color05);
    border: 2px solid var(--color01);
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    color: white;
    user-select: none;
}

.command-card:hover {
    transform: translateY(-2px);
    border-color: var(--color02);
}

.command-card .card-icon {
    font-size: 1.7em;
    display: block;
    margin-bottom: 6px;
}

.command-card .card-title {
    display: block;
    font-weight: bold;
    font-size: 0.95em;
}

.command-card .card-subtitle {
    display: block;
    font-size: 0.75em;
    color: #b7b7b7;
    margin-top: 2px;
}

.command-card.selected {
    background-color: var(--color06);
    border-color: var(--color03);
    box-shadow: 0 0 8px rgba(255, 72, 0, 0.5);
}

.command-card.selected .card-subtitle {
    color: var(--color02);
}

.command-card.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Divisor "ou" ─────────────────────────────────────────────────── */
.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 0.85em;
    margin: 18px 0;
    text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--color04);
}

.or-divider::before { margin-right: 10px; }
.or-divider::after { margin-left: 10px; }

/* ── Slider de duracao ────────────────────────────────────────────── */
.duration-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.duration-row span:first-child {
    white-space: nowrap;
    color: white;
}

.duration-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 5px;
    background: var(--color04);
    outline: none;
    accent-color: var(--color01);
}

.duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color01);
    cursor: pointer;
    border: 2px solid var(--color06);
}

.duration-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color01);
    cursor: pointer;
    border: 2px solid var(--color06);
}

.duration-value {
    font-weight: bold;
    color: var(--color02);
    min-width: 60px;
    text-align: right;
}

.duration-hint {
    font-size: 0.8em;
    color: #999;
    margin: 0 0 12px 0;
}

/* ── Toggle liga/desliga ──────────────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color04);
    border-radius: 24px;
    transition: 0.2s;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .switch-slider {
    background-color: var(--color01);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.toggle-row label {
    color: white;
    cursor: pointer;
}

/* ── Linha manual (operacao / valor) ──────────────────────────────── */
.manual-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.manual-row .manual-field {
    flex: 1;
    min-width: 0;
}

.manual-row .manual-field span,
.manual-row .manual-field input,
.manual-row .manual-field select {
    width: 100%;
    box-sizing: border-box;
}

.manual-row .manual-field span {
    display: block;
    font-size: 0.85em;
    color: #ccc;
    margin-bottom: 4px;
    text-align: left;
}

/* ── Compatibilidade com .input-div / .input-container ───────────────
   .input-div (padrao usado em outros geradores do site) tem dois efeitos
   que colidem quando usado como wrapper extra dentro dos componentes
   deste gerador: (1) nao tem flex-grow, entao nao ocupa o espaço que o
   manual-row/duration-row esperam que ele ocupe; (2) ".input-div span"
   forca largura fixa de 180px + alinhamento a direita em QUALQUER span
   descendente, mesmo aninhado varios niveis. display:contents remove a
   "caixa" do wrapper sem tirar os elementos do DOM, resolvendo o (1).
   As regras de span abaixo resolvem o (2).
   Importante: isso NAO afeta .input-container, pois em alguns lugares essa
   classe é usada direto no proprio elemento (ex: "duration-row input-container"),
   e apagar a caixa dele quebraria o layout da propria linha. */
.manual-row .input-div,
#weatherDurationBlock .input-div {
    display: contents;
}

.manual-row span,
.duration-row span:first-child {
    width: auto !important;
    text-align: left !important;
}

@media screen and (max-width: 480px) {
    .command-cards { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .manual-row { flex-direction: column; align-items: stretch; }
    .duration-row { flex-wrap: wrap; }
}