:root {
    --primary: #4CAF50;
    --primary-dark: #2E7D32;
    --primary-light: #81C784;
    --secondary: #C8E6C9;
    --accent: #1B5E20;
    --vibrant-gradient: linear-gradient(135deg, #A8E063 0%, #56AB2F 100%);
    --bg-light: #F1F8F1;
    --bg-sidebar: #E8F5E9;
    --bg-white: #ffffff;
    --text-main: #222222;
    --text-muted: #555555;
    --border: #d0e0d0;
    --white: #FFFFFF;
    --glass: #FFFFFF; /* Más sólido por legibilidad */
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --font-abadi: "Outfit", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-abadi);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.app-wrapper {
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 935px;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 245px;
    height: 100vh;
    padding: 30px 20px;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--accent);
    text-align: center;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-main);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 600;
}

.nav-item:hover, .nav-item.active {
    background: var(--secondary);
    color: var(--accent);
    transform: translateX(5px);
}

.nav-item i {
    margin-right: 14px;
    width: 22px;
}

/* Main Content */
.main-content {
    flex: 1;
    background: var(--bg-white);
    min-height: 100vh;
}

.mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: var(--bg-sidebar);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid var(--border);
    }
    .mobile-header .logo-text { margin-bottom: 0; }
}

.content-area {
    padding: 40px 20px;
}

.centered-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.app-section {
    display: none;
    width: 100%;
}

.app-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Stories / Profiles (Legacy, now inside Feed) */
.story-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    margin-bottom: 10px;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--secondary);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.story-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--primary);
}

/* Cards & Feeds */
.glass {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}

.glass:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
}

.member-task-card {
    background: linear-gradient(to right, #f8fff8, #ffffff);
    border: 1px solid var(--secondary);
    padding: 25px;
    border-radius: 30px;
    width: 100%;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.08);
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: stretch;
}

@media (max-width: 768px) {
    .member-task-card {
        flex-direction: column;
    }
}

.member-profile-side {
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px dashed var(--secondary);
    padding-right: 20px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    .member-profile-side {
        width: 100%;
        border-right: none;
        border-bottom: 2px dashed var(--secondary);
        padding-right: 0;
        padding-bottom: 20px;
    }
}

.member-profile-side:hover {
    transform: scale(1.02);
}

.member-tasks-side {
    flex: 1;
    display: flex;
    gap: 20px;
}
@media (max-width: 900px) {
    .member-tasks-side { flex-direction: column; }
}

.task-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-column-title {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-row {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #eef;
    width: 100%;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content, .onboarding-card, .welcome-card {
    background: white;
    padding: 40px;
    border-radius: 40px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    border: 1px solid var(--secondary);
    text-align: center;
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.welcome-card {
    max-width: 600px;
    padding: 60px 40px;
}

/* Titles */
h1, h2, h3, h4 {
    color: var(--accent);
}

/* Points */
.points-pill {
    background: var(--vibrant-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

/* Pantry Cards */
.pantry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.pantry-card {
    background: #fdfdfd;
    border: 1px solid var(--secondary);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.pantry-card:hover {
    transform: translateY(-5px);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--vibrant-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(86, 171, 47, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s;
}

.fab:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: var(--vibrant-gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(86, 171, 47, 0.5);
}

.btn-secondary {
    background: white;
    color: var(--accent);
    border: 2px solid var(--primary);
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: rgba(0,0,0,0.05);
    color: var(--accent);
}

/* Chat AI Redesign (Gemini/ChatGPT Style) */
.chat-modal-content {
    max-width: 600px !important;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
    background: #fdfdfd;
}

.chat-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
}

.ai-avatar {
    width: 45px;
    height: 45px;
    background: var(--vibrant-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f9fbf9;
}

.message {
    max-width: 85%;
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--vibrant-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 20px 25px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: #f5f5f5;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.chat-input-wrapper input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.btn-send {
    width: 50px;
    height: 50px;
    background: var(--vibrant-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-send:hover {
    transform: rotate(-15deg) scale(1.1);
}

/* Welcome Splash Specifics */
.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toasts */
#toastContainer {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

/* Calendar & Health Section */
.calendar-layout {
    display: flex;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.calendar-card {
    flex: 1;
    min-width: 320px;
    padding: 25px;
    background: white;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    position: relative;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: var(--bg-light);
    border-color: var(--border);
}

.calendar-day.today {
    background: var(--secondary);
    color: var(--accent);
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.calendar-day.selected.has-event::after {
    background: white;
}

.calendar-day.other-month {
    color: #ccc;
    font-weight: 400;
}

.events-list-card {
    width: 100%;
    max-width: 350px;
    padding: 25px;
    background: #fdfdfd;
}

@media (max-width: 900px) {
    .events-list-card { max-width: 100%; }
}

.day-events-list {
    margin-top: 20px;
}

.health-event-card {
    background: white;
    padding: 15px;
    border-radius: 16px;
    border-left: 5px solid var(--primary);
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    text-align: left;
    position: relative;
}

.health-event-card h4 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.health-event-card .time {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.health-event-card .member {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-light);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.empty-state {
    color: #aaa;
    font-style: italic;
    padding: 20px 0;
}

.btn-primary-sm {
    background: var(--vibrant-gradient);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(86, 171, 47, 0.2);
}

.btn-primary-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(86, 171, 47, 0.3);
}

.stats-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}
