/* ============================================
   SIMULADOR SOLAR v2 - Rising Sun Ecuador
   Clean white design matching index.html
   ============================================ */

/* ─── Nav Hover (all pages) ───────────────── */
nav .nav-link:hover,
nav .megamenu-trigger:hover { color: #d97706 !important; transition: color 0.2s ease; }

/* ─── Hero ────────────────────────────────── */
.sim-hero {
    background: #f8f8f8;
    padding: 60px 0 30px;
    text-align: center;
}
.sim-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}
.sim-hero h1 span {
    color: #EF7C0B;
}
.sim-hero p {
    font-size: 1rem;
    color: #666;
    max-width: 550px;
    margin: 0 auto;
}

/* ─── Progress Steps ─────────────────────── */
.step-progress {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 28px auto 0;
    max-width: 420px;
}
.step-indicator {
    display: flex;
    align-items: center;
    flex: 1;
}
.step-indicator:last-child .step-line { display: none; }
.step-circle {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #e9e9e9;
    border: 2px solid #ddd;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: #999;
    transition: all 0.3s ease;
    flex-shrink: 0; position: relative; z-index: 2;
}
.step-circle .step-icon { display: none; }
.step-line {
    flex: 1; height: 3px;
    background: #ddd;
    margin: 0 -2px;
    transition: all 0.3s ease;
    z-index: 1;
}
.step-indicator.active .step-circle,
.step-indicator.completed .step-circle {
    background: #EF7C0B;
    border-color: #EF7C0B;
    color: white;
    box-shadow: 0 2px 10px rgba(239,124,11,0.3);
}
.step-indicator.completed .step-circle .step-num { display: none; }
.step-indicator.completed .step-circle .step-icon { display: block; }
.step-indicator.completed .step-line { background: #EF7C0B; }

/* ─── Wizard ──────────────────────────────── */
.sim-wizard {
    padding: 24px 0 60px;
}
.wizard-step {
    display: none;
    animation: fadeUp 0.4s ease;
}
.wizard-step.active { display: block; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-label {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 16px;
}
.section-label:first-child { margin-top: 0; }
.section-label h2 {
    font-size: 1.5rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.3rem;
}
.section-label p { color: #888; font-size: 0.9rem; }

/* ─── Step 1: Cards ──────────────────────── */
.type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 620px;
    margin: 0 auto;
}
.type-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 2.2rem 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}
.type-card:hover { border-color: #EF7C0B; box-shadow: 0 4px 20px rgba(239,124,11,0.08); }
.type-card.selected { border-color: #EF7C0B; background: #FFF8F0; }
.type-card .card-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.type-card.selected .card-icon,
.type-card:hover .card-icon { background: #EF7C0B; }
.type-card .card-icon svg { width: 28px; height: 28px; stroke: #555; fill: none; stroke-width: 1.5; transition: all 0.25s; }
.type-card.selected .card-icon svg,
.type-card:hover .card-icon svg { stroke: white; }
.type-card h3 { font-size: 1.2rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.4rem; }
.type-card p { font-size: 0.8rem; color: #888; margin: 0; }

/* ─── Step 2: Layout ─────────────────────── */
.step2-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    min-height: 480px;
}
.city-panel {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex; flex-direction: column; gap: 14px;
}
.styled-select select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none; -webkit-appearance: none;
    outline: none;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.styled-select select:focus { border-color: #EF7C0B; box-shadow: 0 0 0 3px rgba(239,124,11,0.1); }

.gps-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    background: #EF7C0B; color: white;
    font-weight: 600; font-size: 0.85rem;
    border: none; border-radius: 8px;
    cursor: pointer; transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.gps-btn:hover { background: #d96d00; }
.gps-btn svg { width: 16px; height: 16px; }

.location-info {
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #888;
}
.location-info span { color: #EF7C0B; font-weight: 600; }

.city-data-preview .data-row {
    display: flex; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
}
.city-data-preview .data-row:last-child { border-bottom: none; }
.city-data-preview .data-label { color: #888; }
.city-data-preview .data-value { color: #EF7C0B; font-weight: 600; }

/* Map */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    min-height: 480px;
    border: 1px solid #eee;
    position: relative;
}
#sim-map { width: 100%; height: 100%; min-height: 480px; }

/* Drawing toolbar */
.draw-toolbar {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 5;
    display: flex !important; flex-direction: column; gap: 6px;
}
.draw-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: white; color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.draw-btn:hover { border-color: #EF7C0B; color: #EF7C0B; }
.draw-btn.active { background: #EF7C0B; color: white; border-color: #EF7C0B; }
.draw-btn svg { width: 14px; height: 14px; }
.panel-count-badge {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 5;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem; font-weight: 700; color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.panel-count-badge span { color: #EF7C0B; }

/* ─── Step 3: Params ─────────────────────── */
.params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 840px;
    margin: 0 auto;
}
.param-group {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex; flex-direction: column; gap: 8px;
}
.param-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 600;
}
.param-group input[type="number"],
.param-group select {
    padding: 12px 14px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    font-size: 1.05rem; font-weight: 600;
    font-family: 'Inter', sans-serif;
    outline: none; appearance: none; -webkit-appearance: none;
    transition: all 0.2s;
}
.param-group input[type="number"]:focus,
.param-group select:focus { border-color: #EF7C0B; box-shadow: 0 0 0 3px rgba(239,124,11,0.1); }

/* Range */
.range-container { position: relative; padding-top: 6px; }
.range-container input[type="range"] {
    width: 100%; height: 5px;
    -webkit-appearance: none; appearance: none;
    background: #e0e0e0; border-radius: 3px; outline: none;
}
.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #EF7C0B;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(239,124,11,0.3);
    border: 2px solid white;
}
.range-value {
    position: absolute; top: -8px; right: 0;
    font-size: 1.1rem; font-weight: 700; color: #EF7C0B;
}

/* Toggle */
.toggle-group {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}
.toggle-option {
    flex: 1;
    padding: 12px 14px;
    text-align: center;
    cursor: pointer;
    font-weight: 600; font-size: 0.9rem; color: #999;
    transition: all 0.2s;
    border: none; background: none;
    font-family: 'Inter', sans-serif;
}
.toggle-option.active { background: #EF7C0B; color: white; }

/* ─── Results ─────────────────────────────── */
.results-section {
    padding: 50px 0 60px;
    background: #f8f8f8;
    display: none;
}
.results-section.visible { display: block; animation: fadeUp 0.5s ease; }
.results-header {
    text-align: center; margin-bottom: 36px;
}
.results-header h2 { font-size: 1.8rem; font-weight: 800; color: #1a1a1a; margin-bottom: 0.3rem; }
.results-header h2 span { color: #EF7C0B; }

.results-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}
.result-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    text-align: center;
    padding: 1.5rem 1rem;
    animation: fadeUp 0.4s ease forwards;
}
.result-card:nth-child(2) { animation-delay: 0.08s; }
.result-card:nth-child(3) { animation-delay: 0.16s; }
.result-card:nth-child(4) { animation-delay: 0.24s; }
.result-card .rc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: #FFF3E0;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.8rem;
}
.result-card .rc-icon svg { width: 22px; height: 22px; stroke: #EF7C0B; fill: none; stroke-width: 1.8; }
.result-card .rc-value {
    font-size: 1.8rem; font-weight: 800; color: #EF7C0B; margin-bottom: 0.2rem;
}
.result-card .rc-label {
    font-size: 0.72rem; color: #999; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 36px;
}
.chart-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.2rem;
}
.chart-card h4 {
    font-size: 0.9rem; font-weight: 700; color: #333;
    margin-bottom: 0.8rem;
    display: flex; align-items: center; gap: 6px;
}
.chart-card h4 .chart-dot { width: 7px; height: 7px; border-radius: 50%; background: #EF7C0B; }
.chart-card canvas { max-height: 260px; }

/* Map result */
.map-result-container {
    border-radius: 12px; overflow: hidden;
    border: 1px solid #eee;
    height: 420px; position: relative;
    background: white;
}
#result-map { width: 100%; height: 100%; }
.map-legend {
    position: absolute;
    bottom: 14px; left: 14px; z-index: 400;
    background: rgba(255,255,255,0.95);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 0.75rem; color: #666;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.map-legend .legend-item { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.map-legend .legend-item:last-child { margin-bottom: 0; }
.map-legend .legend-color { width: 12px; height: 12px; border-radius: 2px; }

/* ─── Wizard Nav ──────────────────────────── */
.wizard-nav {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 840px;
    margin: 32px auto 0;
}
.btn-wizard {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; border: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-wizard:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-back { background: #f0f0f0; color: #555; }
.btn-back:hover:not(:disabled) { background: #e5e5e5; }
.btn-next { background: #EF7C0B; color: white; }
.btn-next:hover:not(:disabled) { background: #d96d00; }
.btn-calc { padding: 14px 36px; font-size: 1rem; }

/* ─── CTA ─────────────────────────────────── */
.sim-cta {
    text-align: center; padding: 50px 0;
    background: white;
}
.sim-cta h3 { font-size: 1.4rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.4rem; }
.sim-cta p { color: #888; margin-bottom: 1.2rem; }
.btn-cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 30px;
    background: #EF7C0B; color: white;
    font-weight: 700; font-size: 0.95rem;
    border: none; border-radius: 8px;
    cursor: pointer; text-decoration: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.btn-cta:hover { background: #d96d00; }

/* Print / PDF */
.btn-print, .btn-pdf {
    background: #f5f5f5; color: #555;
    border: 1px solid #ddd;
    padding: 8px 16px; border-radius: 8px;
    cursor: pointer; font-family: 'Inter', sans-serif;
    font-weight: 600; font-size: 0.82rem;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
    margin: 0 4px;
}
.btn-print:hover, .btn-pdf:hover { border-color: #EF7C0B; color: #EF7C0B; }

/* ─── Responsive ──────────────────────────── */
@media (max-width: 991px) {
    .step2-layout { grid-template-columns: 1fr; }
    .map-container, #sim-map { min-height: 350px; }
    .results-cards { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .params-grid { grid-template-columns: 1fr; }

}
@media (max-width: 767px) {
    .sim-hero h1 { font-size: 1.8rem; }
    .type-cards { grid-template-columns: 1fr; max-width: 320px; }
    .results-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .result-card .rc-value { font-size: 1.4rem; }
    .map-result-container { height: 280px; }
    .wizard-nav { flex-direction: column; gap: 10px; }
    .btn-wizard { width: 100%; justify-content: center; }
}

/* Print styles */
@media print {
    .sim-nav-wrapper, .sim-cta, .wizard-nav, .sim-wizard, .footer,
    .btn-print, .btn-pdf, .draw-toolbar, .panel-count-badge { display: none !important; }
    .results-section { display: block !important; background: white !important; padding: 20px 0 !important; }
    .results-section * { break-inside: avoid; }
    .results-cards { grid-template-columns: repeat(4,1fr) !important; }
    .charts-row { grid-template-columns: 1fr 1fr !important; }
}
