@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
    --bg-color: #203500;
    --surface-color: #ffffff;
    --primary-color: #778c43;
    --trust-color: #41470b;
    --alert-color: #c0392b; 
    --text-color: #000000;
    --title-color: #203500;
    --shadow-light: rgba(255, 255, 255, 0.05);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --transition-speed: 0.4s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--title-color);
}

/* Elegant Utilities */
.neu-card {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    border-radius: 0;
    box-shadow: 8px 8px 20px var(--shadow-dark);
    padding: 2rem;
    transition: transform var(--transition-speed) ease;
}

.neu-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--trust-color);
    border-radius: 0;
    padding: 12px 20px;
    outline: none;
    width: 100%;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.3s;
}

.neu-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.neu-input:focus {
    border-color: var(--primary-color);
}

.neu-button {
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 0;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    color: var(--primary-color);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.neu-button:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 4px 15px rgba(119, 140, 67, 0.3);
}

.neu-button:active {
    transform: scale(0.98);
}

.neu-button.primary {
    color: var(--title-color);
    background: var(--primary-color);
}

.neu-button.primary:hover {
    background: transparent;
    color: var(--title-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.fade-in {
    animation: fadeIn var(--transition-speed) forwards;
}

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

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Dashboard Modules */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-title {
    font-size: 1.25rem;
    color: var(--title-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--trust-color);
    padding-bottom: 0.5rem;
}

.list-item {
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid transparent;
}

.list-item.good {
    border-left: 4px solid var(--primary-color);
}

.list-item.alert {
    border-left: 4px solid var(--alert-color);
}

.list-item.info {
    border-left: 4px solid var(--primary-color);
}

/* Floating Chat */
.floating-chat {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 0;
    background: var(--primary-color);
    color: var(--title-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 15px var(--shadow-dark);
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    border-radius: 0;
    box-shadow: 10px 10px 30px var(--shadow-dark);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: var(--primary-color);
    color: var(--title-color);
    padding: 1rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
}

.chat-body {
    height: 300px;
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.05);
}

.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--trust-color);
    display: flex;
    gap: 0.5rem;
}

/* Header */
header {
    background: var(--surface-color);
    padding: 3rem 2rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
}

.logo {
    font-size: 3.5rem;
    letter-spacing: 3px;
    color: var(--title-color);
    text-transform: uppercase;
}

.logo span {
    color: var(--primary-color);
    font-style: italic;
}

header p {
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--trust-color);
    margin-top: 0.5rem;
}

/* Overrides for JS inline styles and specific elements */
.message.user {
    color: var(--primary-color) !important;
}

.module-body {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--trust-color);
    border-radius: 0 !important;
}

/* Dashboard Badge */
#diagnosis-badge {
    background: var(--trust-color) !important;
    border: 1px solid var(--primary-color);
    border-radius: 0 !important;
    letter-spacing: 1px;
    font-weight: 500;
    padding: 5px 15px !important;
}

/* WhatsApp/Email buttons in index.html have hardcoded border-radius 50%, need to fix in html or override here */
a.neu-button[href^="https://wa.me"], a.neu-button[href^="mailto:"] {
    border-radius: 0 !important;
    background: var(--bg-color) !important;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

a.neu-button[href^="https://wa.me"]:hover, a.neu-button[href^="mailto:"]:hover {
    background: var(--primary-color) !important;
    color: var(--bg-color) !important;
}

/* Modal Historial */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: var(--surface-color);
}

.historial-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--primary-color);
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.historial-date {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.historial-text {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.4;
}

/* Imágenes Ilustrativas */
.diet-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 1px solid var(--primary-color);
    box-shadow: 4px 4px 10px var(--shadow-dark);
}
