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

:root {
    --mint-50: #F0F7F7;
    --mint-100: #D6EBEB;
    --mint-200: #B3D5D5;
    --mint-300: #7BB3B3;
    --mint-400: #5A9E9E;
    --mint-500: #4A8E8E;
    --mint-600: #3A7E7E;
    --dark: #1A1A1A;
    --dark-700: #2D3436;
    --gray-400: #6B7280;
    --gray-300: #9CA3AF;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --white: #FFFFFF;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--mint-50);
    color: var(--dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--mint-50);
    position: relative;
    padding-bottom: 90px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px 24px;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray-300);
    font-size: 0.7rem;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--mint-500);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-scan {
    width: 56px;
    height: 56px;
    background: var(--dark-700);
    border-radius: 50%;
    border: 4px solid var(--mint-50);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: -24px;
    transition: transform 0.2s;
}

.nav-scan:hover {
    transform: scale(1.05);
}

.nav-scan svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

/* Page Content */
.page {
    padding: 20px 20px 10px;
}

.page[hidden] {
    display: none;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.greeting {
    font-size: 0.85rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
}

.icon-btn {
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--gray-400);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Featured Card */
.featured-card {
    background: var(--mint-300);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.featured-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.featured-text p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 12px;
    max-width: 160px;
}

.featured-stats {
    display: flex;
    gap: 16px;
}

.featured-stat .value {
    font-size: 1rem;
    font-weight: 700;
}

.featured-stat .label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.featured-illustration {
    width: 100px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.see-all {
    font-size: 0.8rem;
    color: var(--mint-500);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

/* Category Chips */
.chip-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 20px;
    border-radius: var(--radius-xl);
    border: none;
    background: var(--white);
    color: var(--gray-400);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.chip.active {
    background: var(--dark-700);
    color: var(--white);
}

/* Recipe Cards Grid */
.recipes-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-right: -20px;
    padding-right: 20px;
}

.recipes-grid::-webkit-scrollbar {
    display: none;
}

.recipe-card {
    min-width: 200px;
    height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.recipe-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(123, 179, 179, 0.92);
    padding: 14px 16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: var(--white);
}

.recipe-card-overlay h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.recipe-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    opacity: 0.9;
}

.recipe-card-meta .dot {
    width: 3px;
    height: 3px;
    background: var(--white);
    border-radius: 50%;
}

.recipe-card-save {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.3);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

/* Recipe Detail */
.detail-hero {
    position: relative;
    margin: -20px -20px 0;
    height: 280px;
    overflow: hidden;
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-back {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.detail-content {
    padding: 20px;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.detail-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--gray-400);
}

.detail-desc {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Macro Cards */
.macro-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.macro-card {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.macro-card .icon {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.macro-card .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.macro-card .label {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Ingredients */
.ingredients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ingredients-title {
    font-size: 1rem;
    font-weight: 700;
}

.ingredients-count {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.ingredient-name .dot {
    width: 6px;
    height: 6px;
    background: var(--mint-300);
    border-radius: 50%;
}

.ingredient-qty {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* Stats */
.stats-chart {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.stats-chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.circle-progress {
    width: 160px;
    height: 160px;
    margin: 0 auto 10px;
    position: relative;
}

.circle-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-progress .progress-bg {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 12;
}

.circle-progress .progress-fill {
    fill: none;
    stroke: var(--mint-300);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.circle-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.circle-value .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.circle-value .unit {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.circle-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: -4px;
}

/* Macro Stats */
.macro-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.macro-stat {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.macro-stat .value {
    font-size: 1rem;
    font-weight: 700;
}

.macro-stat .label {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Category List */
.category-section {
    margin-bottom: 20px;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
}

.today-dropdown {
    font-size: 0.8rem;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
}

/* Recipe List Item */
.recipe-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.recipe-list-item img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.recipe-list-info {
    flex: 1;
}

.recipe-list-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.recipe-list-info p {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.recipe-list-arrow {
    color: var(--gray-300);
}

/* Scanner */
.scanner-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.scanner-frame {
    width: 220px;
    height: 220px;
    border: 2px solid var(--white);
    border-radius: var(--radius-lg);
    position: relative;
}

.scanner-frame .corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--white);
    border-style: solid;
}

.scanner-frame .corner-tl {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 8px 0 0 0;
}

.scanner-frame .corner-tr {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
    border-radius: 0 8px 0 0;
}

.scanner-frame .corner-bl {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 8px;
}

.scanner-frame .corner-br {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 8px 0;
}

.scanner-result {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.scanner-result h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.scanner-result p {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.scanner-arrow {
    width: 40px;
    height: 40px;
    background: var(--dark-700);
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--white);
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--white);
    color: var(--dark);
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--mint-300);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--white);
    color: var(--dark);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--mint-300);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--mint-400);
}

/* Tag/Ingredient suggestions */
.suggestions {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 150px;
    overflow-y: auto;
    margin-top: 4px;
    z-index: 10;
    position: absolute;
    width: calc(100% - 40px);
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--mint-50);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--mint-100);
    color: var(--mint-600);
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
}

.tag-chip button {
    background: none;
    border: none;
    color: var(--mint-500);
    cursor: pointer;
    font-size: 0.85rem;
}

/* Search bar */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--white);
    outline: none;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-300);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Responsive */
@media (min-width: 768px) {
    .app-container {
        max-width: 430px;
        margin: 20px auto;
        min-height: calc(100vh - 40px);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
    }

    .bottom-nav {
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }
}