:root {
    /* --- TEMA DARK (Por defecto) --- */
    --bg-main: radial-gradient(circle at top center, #1a2a3a 0%, #0f1214 80%);
    --bg-solid: #0f1214;
    --text-main: #e0e0e0;
    --text-title: #ffffff;
    --text-muted: #a0a0a0;
    --card-bg: rgba(20, 25, 30, 0.85);
    --card-border: rgba(0, 210, 255, 0.2);
    --card-hover-border: rgba(0, 210, 255, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --cyan-primary: #00d2ff;
    --cyan-secondary: #3a7bd5;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #ff4444;
    --success-color: #00dd77;
    --nps-bar-bg: rgba(255, 255, 255, 0.1);
    --vote-option-bg: rgba(255, 255, 255, 0.05);
    --vote-option-border: rgba(255, 255, 255, 0.1);
    --vote-option-hover: rgba(255, 255, 255, 0.1);
    --vote-option-selected: rgba(0, 210, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-placeholder: rgba(255, 255, 255, 0.4);
    --review-card-bg: rgba(255, 255, 255, 0.03);
    --review-card-hover: rgba(255, 255, 255, 0.06);
    --title-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

[data-theme='light'] {
    /* --- TEMA LIGHT --- */
    --bg-main: #f8f9fa;
    --bg-solid: #f8f9fa;
    --text-main: #212529;
    --text-title: #1a1d21;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.1);
    --card-hover-border: var(--cyan-primary);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --cyan-primary: #00768a;
    --cyan-secondary: #005a6a;
    --info-color: #00768a;
    --warning-color: #78652a;
    --danger-color: #b02a37;
    --success-color: #198754;
    --nps-bar-bg: rgba(0, 0, 0, 0.1);
    --vote-option-bg: #f1f3f5;
    --vote-option-border: rgba(0, 0, 0, 0.1);
    --vote-option-hover: #e9ecef;
    --vote-option-selected: rgba(0, 118, 138, 0.1);
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-placeholder: #6c757d;
    --review-card-bg: #f1f3f5;
    --review-card-hover: #e9ecef;
    --title-shadow: none;
}

body {
    background: var(--bg-main) !important;
    color: var(--text-main);
    min-height: 100vh;
}

/* Protection for Header/Nav */
.navbar .container-fluid,
header .container-fluid,
nav .container-fluid {
    max-width: none !important;
    width: 100% !important;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--text-title);
    text-shadow: var(--title-shadow);
}

[data-theme='light'] .text-info {
    color: var(--info-color) !important;
}

[data-theme='light'] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme='light'] .text-white-50 {
    color: var(--text-muted) !important;
}

[data-theme='light'] .text-white {
    color: var(--text-title) !important;
}

[data-theme='light'] .border-secondary {
    border-color: var(--card-border) !important;
}

.tech-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px var(--shadow-color);
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.tech-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.chart-container {
    position: relative;
    height: 180px;
    width: 100%;
    margin: 0.5rem 0;
}

.metrics-container {
    font-size: 0.85rem;
}

.metric-row {
    margin-bottom: 8px;
}

.metric-bar-bg {
    height: 6px;
    background: var(--nps-bar-bg);
    border-radius: 3px;
    width: 100%;
    margin-top: 4px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.btn-action {
    width: 100%;
    padding: 0.6rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.btn-vote-trigger {
    background: linear-gradient(90deg, var(--cyan-primary) 0%, var(--cyan-secondary) 100%);
    border: none;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-vote-trigger:hover {
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
    transform: scale(1.02);
    color: #fff !important;
}

.vote-option-label {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: var(--vote-option-bg);
    border: 1px solid var(--vote-option-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: var(--text-main);
}

.vote-option-label:hover {
    background: var(--vote-option-hover);
    border-color: var(--card-hover-border);
}

.vote-option-label:has(input:checked) {
    background: var(--vote-option-selected);
    border-color: var(--cyan-primary);
    color: var(--text-title);
    box-shadow: 0 0 10px var(--shadow-color);
}

.form-check-input {
    margin-right: 10px;
}

[data-theme='dark'] .form-check-input {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.form-check-input:checked {
    background-color: var(--cyan-primary);
    border-color: var(--cyan-primary);
}

.options-scroll-area {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.options-scroll-area::-webkit-scrollbar {
    width: 5px;
}

.options-scroll-area::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 5px;
}

/* ===== NPS Widget Styles ===== */
.nps-widget {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg) 100%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.nps-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 30%, #ffdd00 55%, #00dd77 100%);
    opacity: 0.8;
}

.nps-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-title);
    text-align: center;
    margin-bottom: 1rem;
}

.nps-scale {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.nps-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* NPS Scale buttons with theme awareness */
.nps-btn[data-score="0"] {
    background: rgba(220, 53, 69, 0.6);
}

.nps-btn[data-score="1"] {
    background: rgba(230, 70, 60, 0.6);
}

.nps-btn[data-score="2"] {
    background: rgba(235, 88, 55, 0.6);
}

.nps-btn[data-score="3"] {
    background: rgba(240, 105, 50, 0.6);
}

.nps-btn[data-score="4"] {
    background: rgba(245, 130, 45, 0.6);
}

.nps-btn[data-score="5"] {
    background: rgba(250, 160, 40, 0.55);
}

.nps-btn[data-score="6"] {
    background: rgba(255, 190, 35, 0.5);
}

.nps-btn[data-score="7"] {
    background: rgba(200, 210, 50, 0.5);
}

.nps-btn[data-score="8"] {
    background: rgba(150, 210, 70, 0.5);
}

.nps-btn[data-score="9"] {
    background: rgba(70, 190, 90, 0.55);
}

.nps-btn[data-score="10"] {
    background: rgba(40, 167, 69, 0.6);
}

[data-theme='light'] .nps-btn {
    color: #fff;
}

[data-theme='light'] .nps-btn[data-score="0"] {
    background: #dc3545;
}

[data-theme='light'] .nps-btn[data-score="1"] {
    background: #e6463c;
}

[data-theme='light'] .nps-btn[data-score="2"] {
    background: #eb5837;
}

[data-theme='light'] .nps-btn[data-score="3"] {
    background: #f06932;
}

[data-theme='light'] .nps-btn[data-score="4"] {
    background: #f5822d;
}

[data-theme='light'] .nps-btn[data-score="5"] {
    background: #faa028;
}

[data-theme='light'] .nps-btn[data-score="6"] {
    background: #ffbe23;
}

[data-theme='light'] .nps-btn[data-score="7"] {
    background: #c8d232;
}

[data-theme='light'] .nps-btn[data-score="8"] {
    background: #96d246;
}

[data-theme='light'] .nps-btn[data-score="9"] {
    background: #46be5a;
}

[data-theme='light'] .nps-btn[data-score="10"] {
    background: #28a745;
}

.nps-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px var(--shadow-color);
    z-index: 2;
}

.nps-btn.selected {
    transform: scale(1.2);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.5), 0 4px 20px var(--shadow-color);
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 5px;
    max-width: 520px;
    margin: 0 auto;
}

.nps-feedback {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--success-color);
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.nps-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* NPS Results Display */
.nps-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.nps-score-box {
    text-align: center;
}

.nps-score-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 20px currentColor;
}

.nps-score-value.score-positive {
    color: var(--success-color);
}

.nps-score-value.score-neutral {
    color: var(--warning-color);
}

.nps-score-value.score-negative {
    color: var(--danger-color);
}

.nps-score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 4px;
}

.nps-bar-container {
    flex: 1;
    max-width: 300px;
    min-width: 200px;
}

.nps-bar {
    height: 12px;
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    background: var(--nps-bar-bg);
}

.nps-bar-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.nps-bar-segment.detractors {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.nps-bar-segment.passives {
    background: linear-gradient(90deg, #ffc107, #ffdd57);
}

.nps-bar-segment.promoters {
    background: linear-gradient(90deg, #28a745, #00dd77);
}

.nps-bar-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.nps-participants {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.nps-participants strong {
    color: var(--text-title);
}

.nps-comment-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.nps-comment-section.show {
    max-height: 120px;
    opacity: 1;
    margin-top: 1rem;
}

.nps-comment-input {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 10px 15px;
    font-size: 0.9rem;
    resize: none;
    transition: border-color 0.2s;
}

.nps-comment-input::placeholder {
    color: var(--input-placeholder);
}

.nps-comment-input:focus {
    outline: none;
    border-color: var(--cyan-primary);
    background: var(--input-bg);
}

.nps-submit-btn {
    display: block;
    margin: 10px auto 0;
    padding: 8px 30px;
    background: linear-gradient(90deg, var(--cyan-primary) 0%, var(--cyan-secondary) 100%);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nps-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.nps-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nps-reviews-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    max-height: 400px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nps-reviews-section::-webkit-scrollbar {
    width: 6px;
}

.nps-reviews-section::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.nps-review-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--review-card-bg);
    border-radius: 12px;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, background 0.2s;
}

.nps-review-card:hover {
    background: var(--review-card-hover);
    transform: translateX(3px);
}

.nps-review-card.promoter {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.08);
}

.nps-review-card.neutral {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.08);
}

.nps-review-card.detractor {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.nps-review-score {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nps-review-card.promoter .nps-review-score {
    background: rgba(40, 167, 69, 0.5);
}

.nps-review-card.neutral .nps-review-score {
    background: rgba(255, 193, 7, 0.5);
    color: #333;
}

.nps-review-card.detractor .nps-review-score {
    background: rgba(220, 53, 69, 0.5);
}

.nps-review-content {
    flex: 1;
}

.nps-review-text {
    margin: 0 0 4px 0;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
}

.nps-review-text.no-comment {
    color: var(--text-muted);
}

.nps-review-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--cyan-primary);
}

@media (max-width: 576px) {
    .nps-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .nps-scale {
        gap: 4px;
    }

    .nps-widget {
        padding: 1rem 1rem;
    }

    .theme-toggle {
        top: 70px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}