:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3 {
    font-weight: 600;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}

.view {
    padding: 20px;
    padding-bottom: 100px;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Auth View */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90vh;
    text-align: center;
}

.auth-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-container p {
    color: var(--text-dim);
    margin-bottom: 30px;
}

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input,
select {
    background: var(--card-bg);
    border: 1px solid var(--glass);
    padding: 15px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--primary);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

button:active {
    transform: scale(0.98);
}

/* Header & Cards */
header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.settings-trigger {
    font-size: 1.5rem;
    cursor: pointer;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--glass);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.card h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.card .val {
    font-size: 1.5rem;
    font-weight: 700;
}

.card .sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 5px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 100;
}

/* Reports List */
.day-group {
    margin-bottom: 30px;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--glass);
}

.day-header h2 {
    font-size: 1.1rem;
}

.day-summary {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.food-entry {
    background: var(--card-bg);
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.food-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #334155;
    object-fit: cover;
}

.food-info {
    flex: 1;
}

.food-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.food-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.food-stats {
    text-align: right;
}

.food-stats .cals {
    font-weight: 600;
    display: block;
}

.food-stats .prot {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.delete-food-btn {
    background: transparent;
    color: var(--text-dim);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.5;
}

.delete-food-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    opacity: 1;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    padding: 15px 0;
    border-top: 1px solid var(--glass);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    padding: 30px;
    border-radius: 25px;
    position: relative;
    overflow-y: auto;
}

.close,
.close-settings {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
}

/* Camera Preview */
.camera-preview-container {
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

#video,
#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
}

#camera-controls button,
.custom-file-upload {
    padding: 8px 15px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#file-upload {
    display: none;
}

/* Suggestions */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--glass);
    border-radius: 0 0 12px 12px;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--glass);
}

.suggestion-item:hover {
    background: var(--glass);
}

/* Charts */
.chart-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.weight-form {
    display: flex;
    gap: 10px;
}

.weight-form input {
    flex: 1;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.food-entry {
    animation: slideIn 0.3s ease-out backwards;
}