:root {
    --bg-color: #F8F5F0; /* Soft warm cream */
    --surface-color: #FFFFFF;
    --sidebar-bg: #EAE4D9; /* Light bamboo/linen */
    --primary-green: #5C7A61; /* Natural leaf green */
    --primary-green-hover: #48614D;
    --bamboo-wood: #D4B88E; /* Bamboo tone */
    --text-main: #3D3935;
    --text-light: #7A746B;
    --border-color: #DCD3C6;
    --shadow-soft: 0 4px 20px rgba(92, 122, 97, 0.08);
    --shadow-hover: 0 8px 25px rgba(92, 122, 97, 0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    font-size: 16px; /* Aumentamos el tamaño base para mejor lectura */
    line-height: 1.6;
}

/* Tipografía base y formularios */
p {
    font-size: 16px;
}

input, textarea, select {
    font-size: 16px !important; /* Evita que los inputs sean pequeños, ideal para móvil y vista general */
}

.badge {
    font-size: 14px !important; /* Un poco más grandes para que no cueste leerlos */
}

/* Texture overlay for bamboo feel */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
    background-image: repeating-linear-gradient(90deg, rgba(212,184,142,0.1) 0px, rgba(212,184,142,0.1) 1px, transparent 1px, transparent 20px);
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    background-color: rgba(248, 245, 240, 0.9);
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 0 10px;
}

.logo-icon {
    color: var(--primary-green);
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--primary-green);
}

.nav-links a.active {
    background-color: var(--surface-color);
    color: var(--primary-green);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.ai-button-container {
    margin-top: auto;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green), #48614D);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
}

/* Views (Dashboard, etc.) */
.view-section {
    animation: fadeIn 0.4s ease-out forwards;
}

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

.header-section {
    margin-bottom: 40px;
}

.header-section h2 {
    font-size: 36px;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.header-section p {
    color: var(--text-light);
    font-size: 18px;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    border: 1px solid rgba(212, 184, 142, 0.2);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-box {
    width: 60px;
    height: 60px;
    background-color: rgba(212, 184, 142, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bamboo-wood);
}

.stat-info h3 {
    font-size: 24px;
    color: var(--text-main);
}

.stat-info span {
    color: var(--text-light);
    font-size: 14px;
}

/* Lists and Items */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.item-row:hover {
    transform: translateX(4px);
}

.item-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: rgba(92, 122, 97, 0.1);
    color: var(--primary-green);
}

/* Accordion for Recipes */
.recipe-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.recipe-header {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.recipe-header:hover {
    background-color: rgba(212, 184, 142, 0.05);
}

.recipe-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chevron-icon {
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.chevron-icon.open {
    transform: rotate(180deg);
}

.recipe-details {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(248, 245, 240, 0.5);
    line-height: 1.6;
}

.recipe-details.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.recipe-details h4 {
    color: var(--primary-green);
    margin: 16px 0 8px 0;
    font-size: 16px;
}

.recipe-details h4:first-child {
    margin-top: 0;
}

.recipe-details ul {
    list-style-position: inside;
    color: var(--text-main);
    margin-bottom: 16px;
}

.recipe-details p {
    color: var(--text-main);
    white-space: pre-line;
}

/* Loading AI State */
.ai-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--sidebar-bg);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

/* Form elements */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(92, 122, 97, 0.1);
}

select {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    background-color: white;
    max-width: 100%;
}


/* Responsive Design: Tablets & Mobile */

/* Tablets (1024px and below) - Collapsed Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 30px 10px;
        align-items: center;
    }
    .logo-container img {
        width: 40px !important;
        height: auto;
    }
    .logo-text, .nav-links a span, .btn-primary span {
        display: none;
    }
    .nav-links a {
        justify-content: center;
        padding: 14px;
    }
    .nav-links a svg {
        margin: 0;
    }
    .main-content {
        padding: 30px;
    }
}

/* Mobile (768px and below) - Hamburger Menu */
.mobile-header {
    display: none;
    background-color: var(--surface-color);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-green);
    padding: 5px;
}

.mobile-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
}

@media (max-width: 768px) {
    body {
        font-size: 17px; /* Más grande en móviles para lectura cómoda */
    }
    
    body, .app-container {
        flex-direction: column;
    }
    
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        width: 280px;
        z-index: 1001;
        background-color: var(--sidebar-bg);
        transition: left 0.3s ease;
        padding: 30px 20px;
        align-items: flex-start;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }

    .logo-container img {
        width: 120px !important;
    }
    
    .nav-links a span, .btn-primary span {
        display: inline;
    }
    
    .nav-links a {
        justify-content: flex-start;
        width: 100%;
    }

    .main-content {
        padding: 20px;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .shopping-container {
        flex-direction: column;
    }
}

/* Receta Acciones y Banners */
.recipe-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    align-items: center;
    justify-content: flex-end;
}

.btn-action-recipe {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-action-recipe:hover {
    transform: scale(1.12);
    border-color: var(--primary-green);
    color: var(--primary-green);
    box-shadow: 0 4px 8px rgba(92, 122, 97, 0.15);
}

.btn-action-recipe.active-heart {
    background: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
}

.btn-action-recipe.active-voice {
    background: var(--primary-green) !important;
    color: white !important;
    border-color: var(--primary-green) !important;
    animation: pulse-voice 1.5s infinite;
}

.btn-action-recipe.active-camera {
    background: var(--bamboo-wood) !important;
    color: white !important;
    border-color: var(--bamboo-wood) !important;
}

@keyframes pulse-voice {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(92, 122, 97, 0.5); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(92, 122, 97, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(92, 122, 97, 0); }
}

.recipe-image-banner {
    width: 100%;
    height: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(212, 184, 142, 0.25);
}

.recipe-image-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.recipe-image-banner img:hover {
    transform: scale(1.05);
}

.recipe-image-banner.loading-placeholder {
    background: #eae4d9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ==========================================
   LANDING / HOME VIEW STYLES
   ========================================== */
.landing-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 60px 20px;
    animation: fadeIn 0.5s ease-out forwards;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 50px;
    border-bottom: 1px solid rgba(212, 184, 142, 0.15);
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-logo span {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: -0.5px;
}

.landing-nav {
    display: flex;
    gap: 25px;
    list-style: none;
    align-items: center;
}

.landing-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
}

.landing-nav a:hover {
    color: var(--primary-green);
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 90px;
}

.landing-hero-content h1 {
    font-size: 46px;
    line-height: 1.2;
    color: var(--primary-green);
    margin-bottom: 24px;
    font-weight: 700;
}

.landing-hero-content p {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.6;
}

.landing-hero-ctas {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.landing-auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 35px;
    box-shadow: 0 15px 35px rgba(92, 122, 97, 0.12);
}

.landing-features-title {
    text-align: center;
    margin-bottom: 50px;
}

.landing-features-title h2 {
    font-size: 36px;
    color: var(--primary-green);
    margin-bottom: 12px;
    font-weight: 700;
}

.landing-features-title p {
    color: var(--text-light);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 90px;
}

.landing-feature-card {
    background-color: var(--surface-color);
    padding: 35px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 184, 142, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.landing-feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.landing-feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background-color: rgba(92, 122, 97, 0.1);
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.landing-feature-icon svg {
    width: 24px;
    height: 24px;
}

.landing-feature-card h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 12px;
    font-weight: 600;
}

.landing-feature-card p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

.landing-demo-section {
    background-color: rgba(212, 184, 142, 0.08);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 184, 142, 0.25);
    margin-bottom: 90px;
}

.landing-demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.landing-demo-desc h2 {
    font-weight: 700;
}

.landing-demo-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.landing-footer {
    padding: 60px 0 20px 0;
    border-top: 1px solid var(--border-color);
    background-color: rgba(212, 184, 142, 0.05);
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.footer-links-group h4, .footer-social h4 {
    color: var(--primary-green);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links-group ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-group a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 15px;
}

.footer-links-group a:hover {
    color: var(--primary-green);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: var(--primary-green);
    background: rgba(92, 122, 97, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(212, 184, 142, 0.2);
    color: var(--text-light);
    font-size: 14px;
}

/* Responsive styles for landing */
@media (max-width: 900px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .landing-demo-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .landing-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .landing-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .landing-hero-content h1 {
        font-size: 32px;
    }
    .landing-hero-ctas {
        flex-direction: column;
        width: 100%;
    }
    .landing-hero-ctas button {
        width: 100%;
    }
    .landing-container {
        padding: 10px;
    }
    .landing-demo-section {
        padding: 40px 20px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-brand p {
        margin: 0 auto;
    }
    .social-icons {
        justify-content: center;
    }
}

/* Landing Mode overrides to make the Home page a true full-width landing page */
.app-container.landing-mode {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background-color: transparent;
    box-shadow: none;
}

.app-container.landing-mode .sidebar {
    display: none !important;
}

.app-container.landing-mode .mobile-header {
    display: none !important;
}

.app-container.landing-mode .main-content {
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* ==========================================
   TOAST NOTIFICATION SYSTEM
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid transparent;
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    word-break: break-word;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toast.toast-hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 2px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Types */
.toast-success {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), var(--surface-color));
}
.toast-success .toast-icon { color: #2ecc71; }

.toast-error {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), var(--surface-color));
}
.toast-error .toast-icon { color: #e74c3c; }

.toast-warning {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.08), var(--surface-color));
}
.toast-warning .toast-icon { color: #f39c12; }

.toast-info {
    border-left-color: var(--primary-green);
    background: linear-gradient(135deg, rgba(92, 122, 97, 0.08), var(--surface-color));
}
.toast-info .toast-icon { color: var(--primary-green); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}

/* Toast responsive for mobile */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: 100%;
        width: auto;
    }
}
