:root {
    /* Premium Color Palette */
    --bg-color: #0b0f19;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8b95a5;
    
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --primary-solid: #4facfe;

    --protein: #ff7675;
    --carbs: #fdcb6e;
    --fat: #00b894;

    --glass-blur: blur(20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(79, 172, 254, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 254, 0.08) 0%, transparent 50%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* App Container (Mobile First) */
.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-bottom: 50px;
    position: relative;
    z-index: 1;
}

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

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

.custom-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px; /* bordes redondeados */
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

/* Dashboard UI */
.dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.kcal-circle {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 30px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
    filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.3));
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.5;
}

.circle-progress {
    fill: none;
    stroke: var(--primary-solid);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.kcal-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.consumed {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.macros-cards {
    display: flex;
    gap: 15px;
    width: 100%;
}

.macro-card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 10px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.macro-value {
    font-size: 20px;
    font-weight: 700;
}

.macro-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.macro-card.protein .macro-value { color: var(--protein); }
.macro-card.carbs .macro-value { color: var(--carbs); }
.macro-card.fat .macro-value { color: var(--fat); }

/* Input Section */
.ai-input-wrapper {
    margin-bottom: 40px;
}

.input-glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

textarea {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 16px;
    resize: none;
    height: 70px;
    outline: none;
}
textarea::placeholder {
    color: #555c6b;
}

.ai-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.ai-btn:active {
    transform: scale(0.97);
}

.ai-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 0 10px rgba(79, 172, 254, 0.4); }
    to { box-shadow: 0 0 25px rgba(79, 172, 254, 0.8); }
}

/* History Section */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.food-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.food-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: var(--glass-blur);
    animation: slideUp 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.food-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.food-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.food-cals {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-solid);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
    background: transparent;
    border: 1px dashed var(--card-border);
    border-radius: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: #111827;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(1);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal {
    transform: scale(0.9);
}

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

.modal-header h2 {
    font-size: 20px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-size: 16px;
}

.input-group input:focus {
    border-color: var(--primary-solid);
    outline: none;
}

.input-group small {
    font-size: 12px;
    color: var(--text-muted);
}

.primary-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
}

/* Action Buttons & Softball */
.action-buttons {
    display: flex;
    gap: 10px;
}
.action-buttons button {
    flex: 1;
}

.softball-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.softball-btn:active {
    transform: scale(0.97);
}

.view-history-wrapper {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--primary-solid);
    color: var(--primary-solid);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(79, 172, 254, 0.1);
}

/* History Data Table */
.macros-report {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}
.report-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.report-date {
    font-weight: 600;
    color: var(--primary-solid);
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    min-width: 40px;
}
.report-macros {
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}
.report-macros span strong {
    font-size: 14px;
}

/* Mini Bar Graph */
.report-cals-graph {
    text-align: right;
    min-width: 60px;
}
.report-cals-graph .cals-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.mini-bar {
    width: 60px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}
.mini-bar-fill {
    height: 100%;
    background: var(--primary-solid);
    border-radius: 4px;
}
.mini-bar-fill.over {
    background: #ff7675;
}