:root {
    --primary: #0f1724;
    --secondary: #1e293b;
    --accent: #6ee7b7;
    --accent-dark: #10b981;
    --accent-light: #a7f3d0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --card-bg: rgba(15, 23, 42, 0.8);
    --glass: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 16px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0f1a 0%, #0f1724 50%, #1e293b 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.8rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px rgba(110, 231, 183, 0.5));
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
}

.user-controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0f1724;
    box-shadow: 0 4px 15px rgba(110, 231, 183, 0.3);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(110, 231, 183, 0.4);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.7;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i {
    font-size: 1.6rem;
}

.progress-container {
    margin-bottom: 30px;
    background: var(--glass);
    padding: 20px;
    border-radius: var(--border-radius);
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    width: 0%;
    transition: width 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.section {
    margin-bottom: 35px;
    padding: 25px;
    background: var(--glass);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.section:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent);
    transform: translateX(5px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-score {
    background: var(--secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.question {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-text {
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.5;
}

.choices {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.choice {
    flex: 1;
    min-width: 140px;
}

.choice input {
    display: none;
}

.choice label {
    display: block;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-weight: 500;
}

.choice label:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.choice input:checked + label {
    background: rgba(110, 231, 183, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(110, 231, 183, 0.2);
}

.personal-data {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.data-row {
    display: flex;
    gap: 20px;
}

.data-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.data-field label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.data-field input,
.data-field select,
.data-field textarea {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.data-field input:focus,
.data-field select:focus,
.data-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.2);
}

.data-field textarea {
    resize: vertical;
    min-height: 80px;
}

.condition-details,
.medication-details,
.family-details {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.score-display {
    text-align: center;
    padding: 35px 25px;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.05), rgba(16, 185, 129, 0.05));
    border-radius: var(--border-radius);
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 0%, var(--secondary) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 40px rgba(110, 231, 183, 0.4);
}

.score-inner {
    width: 150px;
    height: 150px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.score-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(110, 231, 183, 0.5);
}

.score-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.status-indicator {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    margin-top: 15px;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-optimal {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-moderate {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-risk {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.chart-container {
    height: 280px;
    margin-top: 20px;
}

.recommendations-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.recommendations-container.show {
    max-height: 2000px;
}

.treatment-section {
    padding: 20px;
}

.treatment-section h3 {
    color: var(--accent);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

.treatment-content-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

/* Scrollbar personalizado */
.treatment-content-scroll::-webkit-scrollbar {
    width: 8px;
}

.treatment-content-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.treatment-content-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.treatment-content-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

.export-link-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.export-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0f1724;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(110, 231, 183, 0.3);
}

.export-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(110, 231, 183, 0.4);
}

.protocol-step {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent);
}

.protocol-step h4 {
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.protocol-step p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 10px;
}

.risk-section {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.risk-section h4 {
    color: var(--danger);
    margin-bottom: 15px;
}

.risk-list {
    list-style: none;
}

.risk-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-list li:last-child {
    border-bottom: none;
}

.risk-list i {
    color: var(--danger);
}

.supplement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.supplement-item {
    background: rgba(110, 231, 183, 0.1);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(110, 231, 183, 0.2);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.schedule-table th, .schedule-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    font-weight: 600;
}

.recommendations-list {
    list-style: none;
}

.recommendations-list li {
    padding: 15px 18px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.recommendations-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-left-color: var(--accent);
}

.recommendations-list li i {
    color: var(--accent);
    font-size: 1.3rem;
    min-width: 25px;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.badge {
    padding: 10px 18px;
    background: rgba(110, 231, 183, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(110, 231, 183, 0.3);
    transition: var(--transition);
}

.badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(110, 231, 183, 0.2);
}

.badge i {
    color: var(--accent);
    font-size: 1.1rem;
}

.password-protected {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 15px;
}

.password-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.password-input input {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1rem;
    width: 200px;
}

.password-input button {
    padding: 12px 20px;
    background: var(--accent);
    color: #0f1724;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comparison-table th, .comparison-table td {
    padding: 15px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
}

.comparison-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.history-date {
    font-weight: 600;
}

.history-score {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.2rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--accent);
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

footer {
    margin-top: 50px;
    text-align: center;
    padding: 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--card-bg);
    border-radius: var(--border-radius);
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .data-row {
        flex-direction: column;
    }
    
    .choices {
        flex-direction: column;
    }
    
    .choice {
        min-width: 100%;
    }
    
    .user-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .treatment-content-scroll {
        max-height: 300px;
    }
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.stagger-item {
    opacity: 0;
}

.metabolic-type {
    padding: 20px;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: var(--border-radius);
    margin-top: 20px;
    border: 1px solid rgba(110, 231, 183, 0.2);
}

.metabolic-type h4 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.metabolic-description {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Estilos para navegación automática */
.auto-navigate-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--primary);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.auto-navigate-notification i {
    font-size: 1.2rem;
}

.dashboard-section {
    scroll-margin-top: 20px;
}