/* ========================================
   NIRVANA — Tu paz viajera
   iOS Premium Mobile Design
   ======================================== */

/* === Variables === */
:root {
    /* Colors — Paleta Aguamarina */
    --primary: #00C9B7;
    --primary-light: #5DE3D6;
    --primary-dark: #009B8D;
    --primary-blue: #00C9B7; /* Alias para compatibilidad */
    --primary-blue-dark: #009B8D; /* Alias para compatibilidad */
    
    --background: #FAFEFE;
    --surface: #FFFFFF;
    --surface-hover: #F0FFFE;
    
    --text-primary: #1A3A3A;
    --text-secondary: #5B7B7B;
    --text-tertiary: #8FA5A5;
    --border-light: #E0F9F6;
    
    --error: #FF6B6B;
    --success: #00D4AA;
    --warning: #FFB84D;
    
    --accent-coral: #FFD4C4;
    --accent-mint: #E0F9F6;
    
    /* Spacing */
    --safe-area-top: env(safe-area-inset-top, 20px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --tab-bar-height: 80px;
    
    /* Shadows — Aguamarina tint */
    --shadow-sm: 0 2px 8px rgba(0, 201, 183, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 201, 183, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 201, 183, 0.16);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === App Container === */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
    position: relative;
    padding-bottom: var(--tab-bar-height);
}

/* === Typography === */
h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.text-small {
    font-size: 14px;
}

.text-caption {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === Layout === */
.view {
    min-height: 100vh;
    padding: var(--safe-area-top) 20px calc(var(--tab-bar-height) + 20px) 20px;
    animation: slideIn 0.3s ease-out;
}

.view-with-nav-header {
    padding-top: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Navigation Header === */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: var(--safe-area-top) 16px 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-back-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 17px;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.nav-action {
    min-width: 60px;
    text-align: right;
}

/* === Buttons === */
.btn {
    display: block;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 52px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--primary-blue);
    background: rgba(10, 102, 255, 0.05);
}

.btn-link {
    background: none;
    color: var(--primary-blue);
    height: auto;
    font-size: 15px;
    text-decoration: underline;
}

/* === Cards === */
.card {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.card-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.card-row:active {
    transform: scale(0.98);
    background: #F9F9F9;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-blue), #5B9AFF);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-chevron {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    flex-shrink: 0;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 16px;
    background: var(--surface);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(10, 102, 255, 0.1);
}

.form-textarea {
    min-height: 100px;
    padding: 16px;
    resize: vertical;
    font-family: inherit;
}

.form-error {
    color: var(--error);
    font-size: 14px;
    margin-top: 6px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-blue);
}

/* === Tab Bar === */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    height: calc(var(--tab-bar-height) + var(--safe-area-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 8px 0 var(--safe-area-bottom) 0;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.tab-bar.hidden {
    display: none;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.tab-item.active {
    color: var(--primary-blue);
}

.tab-icon {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

/* === Hero Section === */
.hero-section {
    min-height: calc(100vh - var(--tab-bar-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background: #F5F5F7;
}

.hero-icon-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(10, 102, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hero-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #0A66FF 0%, #00D4FF 50%, #7B61FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(10, 102, 255, 0.15);
}

.hero-icon svg {
    width: 56px;
    height: 56px;
    stroke: white;
    stroke-width: 2.5;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--primary);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.hero-button {
    background: #FFFFFF;
    color: var(--primary);
    width: auto;
    padding: 0 48px;
    margin: 0 auto;
    border-radius: 980px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    transition: all 0.2s ease;
}

.hero-button:hover {
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* === Auth Views === */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.app-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-tagline {
    font-size: 16px;
    color: var(--text-secondary);
}

/* === Progress Indicator === */
.progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--primary-blue);
    width: 24px;
    border-radius: 4px;
}

/* === Segmented Control (Tabs internos) === */
.segmented-control {
    display: flex;
    background: var(--border-light);
    border-radius: 10px;
    padding: 2px;
    margin: 20px 0;
}

.segment-item {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-item.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* === Empty States === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* === Survey (Encuesta) === */
.survey-container {
    padding: 20px;
}

.survey-question {
    margin-bottom: 32px;
}

.survey-question-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.survey-question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.survey-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.survey-option {
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.survey-option:hover {
    border-color: var(--primary-blue);
    background: rgba(10, 102, 255, 0.03);
}

.survey-option.selected {
    border-color: var(--primary-blue);
    background: rgba(10, 102, 255, 0.08);
    box-shadow: 0 2px 8px rgba(10, 102, 255, 0.15);
}

.survey-option-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.survey-option-content {
    flex: 1;
}

.survey-option-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.survey-option-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.survey-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.survey-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.survey-progress-fill {
    height: 100%;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.survey-navigation {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.survey-navigation .btn {
    flex: 1;
}

/* === Utilities === */
.hidden {
    display: none !important;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }

/* === Responsive === */
@media (min-width: 481px) {
    .app-container {
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    }
}

/* === Loading Spinner === */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Animación favoritos === */
@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

button[data-idea-id]:active {
    transform: scale(0.9);
}

button[data-idea-id]:active svg {
    animation: heartPulse 0.3s ease;
}
