/* DBRNovo — Weather Manager */

body.tool-page .weather-manager-container {
    max-width: 1100px;
    margin: 0 auto;
}

body.tool-page .weather-manager {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

body.tool-page .weather-config {
    flex: 1 1 320px;
    padding: 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

body.tool-page .config-section {
    margin-bottom: 1.5rem;
}

body.tool-page .config-section h4 {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── Preset select ── */
body.tool-page .preset-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin: 0 0 1.5rem;
    padding: 1.15rem 1.25rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: var(--radius-sm);
}

body.tool-page .preset-selector label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

body.tool-page .preset-selector select,
body.tool-page select.dark-select,
body.tool-page select.preset-dropdown {
    flex: 1;
    min-width: 200px;
    width: 100%;
    max-width: 100%;
    padding: 0.7rem 2.25rem 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text) !important;
    background-color: rgba(8, 10, 18, 0.85) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

body.tool-page .preset-selector select:hover,
body.tool-page select.dark-select:hover {
    border-color: rgba(59, 130, 246, 0.45);
}

body.tool-page .preset-selector select:focus,
body.tool-page select.dark-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.tool-page .preset-selector select option,
body.tool-page select.dark-select option,
body.tool-page .preset-option {
    background-color: #0f1420 !important;
    color: var(--text) !important;
    padding: 0.5rem;
}

/* ── Weather cards ── */
body.tool-page .weather-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

body.tool-page .weather-card {
    position: relative;
    min-height: 150px;
    padding: 1.15rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    border: 1px solid var(--glass-border);
}

body.tool-page .weather-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.tool-page .weather-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

body.tool-page .weather-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.78));
    z-index: 1;
}

body.tool-page .weather-card.nublado::before { background-image: url('/img/weather/nublado.jpg'); }
body.tool-page .weather-card.nevoa::before { background-image: url('/img/weather/nevoa.jpg'); }
body.tool-page .weather-card.chuva::before { background-image: url('/img/weather/chuva.jpg'); }
body.tool-page .weather-card.vento::before { background-image: url('/img/weather/vento.jpg'); }
body.tool-page .weather-card.tempestade::before { background-image: url('/img/weather/tempestade.jpg'); }
body.tool-page .weather-card.neve::before { background-image: url('/img/weather/neve.jpg'); }

body.tool-page .weather-card .card-title,
body.tool-page .weather-card .card-value,
body.tool-page .weather-card .card-description,
body.tool-page .weather-card .weather-icon,
body.tool-page .weather-card .card-icon {
    position: relative;
    z-index: 2;
}

body.tool-page .weather-card .weather-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.7;
    z-index: 2;
}

body.tool-page .weather-card .card-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

body.tool-page .weather-card .card-value {
    margin: 0 0 0.2rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

body.tool-page .weather-card .card-description {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
}

body.tool-page .weather-card.selected {
    border-color: var(--blue);
    box-shadow: 0 0 20px var(--blue-glow);
}

/* ── Detailed settings ── */
body.tool-page .detailed-settings {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

body.tool-page .settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--glass-border);
}

body.tool-page .settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

body.tool-page .settings-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

body.tool-page .slider-container,
body.tool-page .time-input,
body.tool-page .threshold-input,
body.tool-page .wind-magnitude,
body.tool-page .wind-direction {
    margin-bottom: 0.85rem;
}

body.tool-page .slider-container label,
body.tool-page .time-input label,
body.tool-page .threshold-input label,
body.tool-page .wind-magnitude > label,
body.tool-page .wind-direction > label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

body.tool-page .slider-with-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

body.tool-page .time-inputs,
body.tool-page .threshold-inputs,
body.tool-page .wind-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

body.tool-page .time-input,
body.tool-page .threshold-input {
    flex: 1 1 120px;
}

/* ── Inputs / ranges ── */
body.tool-page .dark-input,
body.tool-page input.number-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: rgba(8, 10, 18, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

body.tool-page .dark-input:focus,
body.tool-page input.number-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body.tool-page .slider-with-value .number-input {
    width: 72px;
    flex-shrink: 0;
}

body.tool-page .dark-slider,
body.tool-page input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

body.tool-page .dark-slider::-webkit-slider-thumb,
body.tool-page input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border: 2px solid #fff;
    box-shadow: 0 2px 8px var(--blue-glow);
    cursor: pointer;
}

body.tool-page .dark-slider::-moz-range-thumb,
body.tool-page input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border: 2px solid #fff;
    box-shadow: 0 2px 8px var(--blue-glow);
    cursor: pointer;
}

/* ── Toggle / config / buttons ── */
body.tool-page .settings-toggle {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

body.tool-page .config-settings {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

body.tool-page .config-settings h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

body.tool-page .config-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.15rem;
}

body.tool-page .config-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

body.tool-page .config-checkbox label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    order: 2;
}

/* Custom checkbox */
body.tool-page .config-checkbox input[type="checkbox"],
body.tool-page input.dark-checkbox,
body.tool-page .weather-manager-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    border: 1.5px solid var(--glass-border-strong);
    border-radius: 5px;
    background: rgba(8, 10, 18, 0.85);
    cursor: pointer;
    position: relative;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    order: 1;
}

body.tool-page .config-checkbox input[type="checkbox"]:hover,
body.tool-page input.dark-checkbox:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

body.tool-page .config-checkbox input[type="checkbox"]:checked,
body.tool-page input.dark-checkbox:checked {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-color: transparent;
    box-shadow: 0 2px 10px var(--blue-glow);
}

body.tool-page .config-checkbox input[type="checkbox"]:checked::after,
body.tool-page input.dark-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

body.tool-page .config-checkbox input[type="checkbox"]:focus-visible,
body.tool-page input.dark-checkbox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Botões — alinha secondary ao visual do site */
body.tool-page .weather-manager-container .btn,
body.tool-page .config-settings .btn,
body.tool-page .settings-toggle .btn,
body.tool-page .xml-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

body.tool-page .weather-manager-container .btn-primary,
body.tool-page .config-settings .btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px var(--blue-glow);
}

body.tool-page .weather-manager-container .btn-primary:hover,
body.tool-page .config-settings .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--blue-glow);
    color: #fff;
}

body.tool-page .weather-manager-container .btn-secondary,
body.tool-page .settings-toggle .btn-secondary,
body.tool-page .xml-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

body.tool-page .weather-manager-container .btn-secondary:hover,
body.tool-page .settings-toggle .btn-secondary:hover,
body.tool-page .xml-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-strong);
    color: var(--text);
}

/* ── XML output ── */
body.tool-page .xml-output-container {
    margin-top: 0.5rem;
    padding: 1.35rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

body.tool-page .xml-output-container h3 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 600;
}

body.tool-page .xml-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

body.tool-page .xml-output {
    margin: 0;
    padding: 1rem;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
}

@media (max-width: 640px) {
    body.tool-page .preset-selector {
        flex-direction: column;
        align-items: stretch;
    }

    body.tool-page .weather-cards {
        grid-template-columns: 1fr;
    }
}
