/* ============================================
   RESET & FONT (Earth & Sage Theme)
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: #F7F5F0;
    color: #3E4A3A;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #3E4A3A;
}

.app-header h1 span {
    background: linear-gradient(135deg, #A8C3A0, #D5DFD0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-sub {
    color: #6B7A66;
    font-size: 16px;
}

/* ============================================
   KARTU & ELEMEN UTAMA
   ============================================ */
.profil-card, .form-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 24px 28px;
    box-shadow: 0 8px 30px rgba(168, 195, 160, 0.15);
    border: 1px solid rgba(213, 223, 208, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.profil-card:hover, .form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(168, 195, 160, 0.25);
}

/* ============================================
   FORM & INPUT
   ============================================ */
.form-input {
    width: 100%;
    padding: 14px 20px;
    background: #FBF9F6;
    border: 2px solid #D5DFD0;
    border-radius: 16px;
    color: #3E4A3A;
    font-size: 15px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #A8C3A0;
    box-shadow: 0 0 0 4px rgba(168, 195, 160, 0.15);
}

.form-input::placeholder {
    color: #A8BAA3;
}

/* ============================================
   TOMBOL
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #A8C3A0, #D5DFD0);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(168, 195, 160, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 195, 160, 0.4);
}

.btn-secondary {
    background: rgba(168, 195, 160, 0.15);
    color: #3E4A3A;
    border: 1px solid #D5DFD0;
}

.btn-secondary:hover {
    background: rgba(168, 195, 160, 0.25);
    transform: translateY(-2px);
}

/* ============================================
   DASHBOARD & RINGKASAN
   ============================================ */
.ringkasan-harian {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.ringkasan-item {
    background: #FBF9F6;
    padding: 16px 12px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #D5DFD0;
}

.ringkasan-item .label {
    display: block;
    font-size: 13px;
    color: #6B7A66;
    margin-bottom: 4px;
}

.ringkasan-item .value {
    font-size: 24px;
    font-weight: 700;
    color: #A8C3A0;
}

.ringkasan-item .sub {
    font-size: 13px;
    color: #6B7A66;
}

/* ============================================
   DAFTAR CATATAN MAKANAN
   ============================================ */
.catatan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.catatan-item {
    background: #FBF9F6;
    border: 1px solid #D5DFD0;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.catatan-item:hover {
    border-color: #A8C3A0;
    background: #FFFFFF;
}

.catatan-item .nama {
    font-weight: 600;
    color: #3E4A3A;
}

.catatan-item .detail {
    font-size: 14px;
    color: #6B7A66;
}

.catatan-item .aksi {
    display: flex;
    gap: 8px;
}

.catatan-item .hapus-btn {
    background: rgba(168, 195, 160, 0.15);
    color: #6B7A66;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.catatan-item .hapus-btn:hover {
    background: #D5DFD0;
    color: #3E4A3A;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #A8BAA3;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    text-align: center;
    padding: 20px 0;
    color: #A8BAA3;
    font-size: 14px;
    border-top: 1px solid #D5DFD0;
}

/* ============================================
   TARGET AREA
   ============================================ */
.target-area, .progres-berat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.target-area label, .progres-berat label {
    color: #3E4A3A;
    font-weight: 600;
}

.target-area .form-input, .progres-berat .form-input {
    max-width: 150px;
}

/* ============================================
   LOGIN SECTION
   ============================================ */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: #FFFFFF;
    padding: 40px 32px;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(168, 195, 160, 0.15);
    border: 1px solid rgba(213, 223, 208, 0.3);
}

.login-card h1 {
    font-size: 32px;
    font-weight: 700;
    color: #3E4A3A;
}

.login-card h1 span {
    background: linear-gradient(135deg, #A8C3A0, #D5DFD0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .subtitle {
    color: #6B7A66;
    margin-bottom: 24px;
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.login-actions .btn {
    flex: 1;
}

/* ============================================
   TAB NAVIGASI LOGIN/REGISTER
   ============================================ */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #FBF9F6;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid #D5DFD0;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #6B7A66;
}

.tab-btn.active {
    background: #A8C3A0;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(168, 195, 160, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(168, 195, 160, 0.1);
}

/* ============================================
   AUTH FORM
   ============================================ */
.auth-form {
    animation: fadeSlide 0.3s ease;
}

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

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form .btn {
    margin-top: 4px;
}

/* Password wrapper di auth form */
.auth-form .password-wrapper {
    position: relative;
}

.auth-form .password-wrapper .form-input {
    padding-right: 50px;
}

.auth-form .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    color: #6B7A66;
    transition: all 0.3s ease;
}

.auth-form .password-toggle:hover {
    background: rgba(168, 195, 160, 0.15);
    color: #3E4A3A;
}

.auth-form .password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* ============================================
   CHAT UI
   ============================================ */
.chat-message {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    word-wrap: break-word;
    animation: fadeSlide 0.3s ease;
}

.chat-message.user {
    background: #A8C3A0;
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.ai {
    background: #FBF9F6;
    color: #3E4A3A;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #D5DFD0;
}

.chat-message .resep-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 8px;
    border-left: 4px solid #A8C3A0;
}

.chat-message .resep-card .judul {
    font-weight: 700;
    font-size: 16px;
    color: #3E4A3A;
}

.chat-message .resep-card .detail {
    font-size: 14px;
    color: #6B7A66;
    margin-top: 4px;
}

.chat-message .resep-card .nutrisi {
    background: rgba(168, 195, 160, 0.1);
    padding: 8px;
    border-radius: 8px;
    margin-top: 6px;
    font-size: 14px;
}

.chat-message .label-premium {
    font-size: 11px;
    background: #A8C3A0;
    color: #FFFFFF;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

.upload-area.dragover {
    border-color: #A8C3A0;
    background: rgba(168, 195, 160, 0.05);
}

/* ============================================
   KAMERA & UPLOAD AREA
   ============================================ */
.upload-area {
    transition: all 0.3s ease;
}

.upload-area .upload-option {
    padding: 12px 20px;
    border-radius: 12px;
    background: #FBF9F6;
    transition: all 0.3s ease;
    min-width: 80px;
}

.upload-area .upload-option:hover {
    background: rgba(168, 195, 160, 0.15);
    transform: translateY(-2px);
}

.upload-area .upload-option:active {
    transform: scale(0.95);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 16px;
    background: #2E7D32;
    color: #FFFFFF;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: fadeSlide 0.3s ease;
    max-width: 90%;
    text-align: center;
}

/* ============================================
   RESPONSIF
   ============================================ */
@media (max-width: 640px) {
    .ringkasan-harian {
        grid-template-columns: repeat(2, 1fr);
    }

    .catatan-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .catatan-item .aksi {
        width: 100%;
        justify-content: flex-end;
    }

    .target-area, .progres-berat {
        flex-direction: column;
        align-items: stretch;
    }

    .target-area .form-input, .progres-berat .form-input {
        max-width: 100%;
    }

    .login-actions {
        flex-direction: column;
    }

    .profil-card, .form-card {
        padding: 18px 16px;
    }

    .login-card {
        padding: 24px 16px;
    }

    .tab-navigation {
        flex-direction: row;
    }

    .chat-message {
        max-width: 95%;
    }
}