/**
 * Satoshi's House — Tools Shared CSS
 * ====================================
 * CSS compartilhado para todas as ferramentas interativas.
 * Cada ferramenta tem seu HTML em /area-membros/ferramentas/<nome>/
 *
 * Depende das CSS vars do tema principal:
 *   --bg, --surface, --surface-2, --border, --border-hover,
 *   --text, --text-muted, --text-dim, --orange, --orange-hover,
 *   --orange-glow, --green, --purple, --purple-glow, --radius, --radius-lg
 */

/* ═══════════════════════════════════════════════════
   RESET & BASE (apenas para paginas de ferramenta)
   ═══════════════════════════════════════════════════ */
.tool-page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════ */
.tool-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}
.tool-topbar__back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}
.tool-topbar__back:hover { color: var(--orange); }
.tool-topbar__badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════
   TOOL HEADER
   ═══════════════════════════════════════════════════ */
.tool-header {
    margin-bottom: 32px;
}
.tool-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}
.tool-header p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
    max-width: 640px;
}

/* ═══════════════════════════════════════════════════
   PLAN BADGES
   ═══════════════════════════════════════════════════ */
.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-badge--free {
    background: rgba(113,113,122,0.15);
    color: #71717a;
    border: 1px solid rgba(113,113,122,0.3);
}
.plan-badge--pro {
    background: rgba(247,147,26,0.15);
    color: #f7931a;
    border: 1px solid rgba(247,147,26,0.3);
}
.plan-badge--premium {
    background: rgba(168,85,247,0.15);
    color: #a855f7;
    border: 1px solid rgba(168,85,247,0.3);
}
.plan-badge--demo {
    background: rgba(113,113,122,0.15);
    color: #71717a;
    border: 1px solid rgba(113,113,122,0.3);
}

/* ═══════════════════════════════════════════════════
   TOOL CARD / PANEL
   ═══════════════════════════════════════════════════ */
.tool-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}
.tool-panel--highlight {
    border-color: rgba(247,147,26,0.2);
}
.tool-panel h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}
.tool-panel h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════ */
.tool-form-group {
    margin-bottom: 18px;
}
.tool-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.tool-input,
.tool-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}
.tool-input:focus,
.tool-select:focus {
    border-color: var(--orange);
}
.tool-input::placeholder {
    color: var(--text-dim);
}
.tool-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
.tool-select option {
    background: var(--surface);
    color: var(--text);
}

/* Inline form row */
.tool-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.tool-btn:active { transform: scale(0.98); }
.tool-btn--primary {
    background: var(--orange);
    color: #000;
}
.tool-btn--primary:hover { background: var(--orange-hover); }
.tool-btn--secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.tool-btn--secondary:hover { border-color: var(--border-hover); }
.tool-btn--premium {
    background: var(--purple);
    color: #fff;
}
.tool-btn--premium:hover { background: #9333ea; }
.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.tool-btn--full {
    width: 100%;
}

/* ═══════════════════════════════════════════════════
   RESULTS / OUTPUT
   ═══════════════════════════════════════════════════ */
.tool-result {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}
.tool-result__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.tool-result__row:last-child { border-bottom: none; }
.tool-result__label {
    color: var(--text-dim);
}
.tool-result__value {
    font-weight: 600;
    color: var(--text);
}
.tool-result__value--green { color: var(--green); }
.tool-result__value--orange { color: var(--orange); }
.tool-result__value--purple { color: var(--purple); }
.tool-result__value--big {
    font-size: 22px;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════
   DEMO OVERLAY (Free users)
   ═══════════════════════════════════════════════════ */
.demo-overlay {
    position: relative;
}
.demo-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
    z-index: 2;
}
.demo-banner {
    background: var(--surface);
    border: 1px solid rgba(247,147,26,0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}
.demo-banner h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.demo-banner p {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   TABLE (comparador, etc)
   ═══════════════════════════════════════════════════ */
.tool-table-wrap {
    overflow-x: auto;
    margin-top: 20px;
}
.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tool-table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.tool-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.tool-table tr:hover td {
    background: rgba(247,147,26,0.03);
}
.tool-table .col-rank { width: 50px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════
   CHART CONTAINER
   ═══════════════════════════════════════════════════ */
.tool-chart-wrap {
    position: relative;
    width: 100%;
    height: 300px;
    margin-top: 16px;
}
.tool-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ═══════════════════════════════════════════════════
   LOADING & STATES
   ═══════════════════════════════════════════════════ */
.tool-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.tool-loading__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: tool-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }

.tool-denied {
    text-align: center;
    padding: 60px 20px;
}
.tool-denied__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--orange-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.tool-denied h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}
.tool-denied p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   RANGE SLIDER
   ═══════════════════════════════════════════════════ */
.tool-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}
.tool-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--orange);
    cursor: pointer;
    border: 2px solid var(--bg);
}
.tool-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--orange);
    cursor: pointer;
    border: 2px solid var(--bg);
}
.tool-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════
   TABS (para ferramentas com multiplas secoes)
   ═══════════════════════════════════════════════════ */
.tool-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tool-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: 'Inter', sans-serif;
    margin-bottom: -1px;
}
.tool-tab:hover { color: var(--text-muted); }
.tool-tab--active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

/* ═══════════════════════════════════════════════════
   NAV FOOTER
   ═══════════════════════════════════════════════════ */
.tool-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 24px 0 12px;
}
.tool-nav a {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.tool-nav a:hover { color: var(--orange); }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes toolFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.tool-panel { animation: toolFadeIn 0.4s ease-out; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .tool-header h1 { font-size: 22px; }
    .tool-panel { padding: 20px; }
    .tool-form-row { grid-template-columns: 1fr; }
    .tool-result__value--big { font-size: 18px; }
    .tool-chart-wrap { height: 220px; }
}
