/* 6Green Premium CSS Style Sheet */

@font-face {
    font-family: 'Boing';
    src: url('fonts/Boing-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-primary: #eff2f0;
    --text-dark: #1b392a; /* Exact color of "歡迎回來" from screenshot */
    --text-muted: #547368;
    --text-green-medium: #016b3f; /* Darker solid green for "回收" and "分享會員卡" */
    --card-bg: #0d382b; /* Original dark green card color */
    --accent-green: #00cc7a; /* Bright green text */
    --accent-light: #e8faf3;
    --modal-bg: #ffffff;
    --phone-bg: #e8ece9; /* Light grey/greenish background for app */
    
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
    --font-numbers: 'Boing', -apple-system, sans-serif;
    
    --bezel-width: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at 50% 30%, #e0e6e3 0%, #cbd2cf 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 430px; /* Width close to standard vertical phone ratio */
    height: 100vh;
    background-color: var(--phone-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); /* Modern soft shadow for desktop */
}

/* App Header styling */
.app-header {
    padding: 30px 24px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 0;
    color: var(--text-dark);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.back-btn:hover {
    opacity: 0.8;
    transform: translateX(-2px);
}

.back-btn:active {
    transform: scale(0.92);
}

.settings-btn {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.settings-btn:hover {
    opacity: 0.8;
}

.settings-btn:active {
    transform: scale(0.92);
}

.settings-gear-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.welcome-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.welcome-text {
    font-size: 26px;
    font-weight: bold;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

/* GREEN$ Card Styling */
.card-container {
    padding: 0 24px;
    z-index: 10;
}

.green-card-wrapper {
    position: relative;
    width: 100%;
}

.green-card {
    position: relative;
    width: 100%;
}

.green-card-bg-img {
    width: 100%;
    height: auto;
    display: block;
}

/* QR Code Button inside Card */
.card-qr-trigger {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background-color: #f2f2f2;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 20;
    padding: 0;
}

.card-qr-trigger:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.card-qr-trigger:active {
    transform: scale(0.95);
}

.card-qr-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

/* Bottom Sheet Modal Container */
.bottom-sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bottom-sheet.active {
    pointer-events: auto;
}

/* Dimmed backdrop inside phone screen */
.sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45); /* Pure dark grey fade */
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.bottom-sheet.active .sheet-backdrop {
    opacity: 1;
}

/* Bottom Sheet Content Panel */
.sheet-content {
    position: relative;
    width: 100%;
    background-color: var(--modal-bg);
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 30px 24px 34px 24px;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
}

.bottom-sheet.active .sheet-content {
    transform: translateY(0);
}

/* Close Button (X) */
.sheet-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sheet-close-btn:hover {
    opacity: 0.8;
}

.sheet-close-btn:active {
    transform: scale(0.92);
}

.close-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Content typography */
.sheet-title {
    font-size: 30px;
    font-weight: bold;
    color: var(--text-green-medium);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.sheet-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-green-medium);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    opacity: 0.8;
}

/* QR Code area wrapper */
.qr-code-box {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.qr-code-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Member ID typography */
.member-id-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
    color: #1b392a;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 4px 12px;
    border-radius: 8px;
}

.member-id-row:hover {
    opacity: 0.85;
    background-color: rgba(27, 57, 42, 0.05);
}

.member-id-row:active {
    transform: scale(0.98);
}

.member-id-label {
    letter-spacing: -0.2px;
    font-weight: normal;
}

.member-id-num {
    font-family: var(--font-numbers);
    font-weight: normal;
    letter-spacing: 0.2px;
}

/* Share membership card button */
.share-card-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: opacity 0.2s ease;
}

.share-card-btn:hover {
    opacity: 0.8;
}

.share-btn-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.share-label {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-green-medium);
    letter-spacing: 0.2px;
}

/* Green Main Content Area (Points and Records) */
.main-content-green {
    flex: 1;
    background-color: #008f59;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 24px;
    color: #ffffff;
}

.points-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.points-label {
    font-size: 17px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.points-val {
    font-family: var(--font-numbers);
    font-size: 68px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.records-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 13px 36px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 78, 48, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.records-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 78, 48, 0.22);
}

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

.records-btn-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.records-btn-label {
    font-size: 17px;
    font-weight: bold;
    color: #008f59;
    letter-spacing: 0.2px;
}

/* Navigation Tab Bar styling */
.app-tab-bar {
    height: 80px;
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 12px 18px 12px; /* Bottom padding accounts for Home Indicator spacing */
    position: relative;
    z-index: 10;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #92a49c; /* Soft grey/greenish inactive tab color */
    width: 20%;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.tab-item.active {
    color: #008f59; /* Green active tab label */
}

.tab-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tab-label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: -0.1px;
}

/* Floating Center Tab (Green$) */
.floating-tab-container {
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 20%;
}

.floating-tab-btn {
    position: absolute;
    top: -36px; /* Pops out above the tab bar */
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    background-color: #0d382b;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 12;
}

.floating-tab-btn:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.floating-tab-btn:active {
    transform: scale(0.95);
}

.floating-tab-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.floating-tab-container .tab-label {
    margin-top: 36px; /* Offset the label vertically to align with other labels */
}

#qrcode {
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode canvas, #qrcode img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Food Waste Badge styling */
.food-waste-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 4px 10px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ff4d4d; /* Red dot for not disposed */
    transition: background-color 0.25s ease;
}

/* Disposed state */
.food-waste-badge.disposed {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.food-waste-badge.disposed .badge-dot {
    background-color: #00ff88; /* Bright green dot for disposed */
}

/* Custom Confirmation Modal */
.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 56, 43, 0.55); /* Tinted backdrop matching modal design */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.confirm-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal-content {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 28px 24px;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-modal-overlay.active .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-title {
    font-size: 19px;
    font-weight: bold;
    color: #1b392a;
    margin-bottom: 12px;
    letter-spacing: -0.1px;
}

.confirm-modal-text {
    font-size: 15px;
    color: #4e635a;
    margin-bottom: 24px;
    line-height: 1.45;
}

.confirm-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.confirm-btn-no, .confirm-btn-yes {
    flex: 1;
    padding: 13px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.confirm-btn-no {
    background-color: #f2f5f3;
    color: #547368;
}

.confirm-btn-yes {
    background-color: #008f59;
    color: #ffffff;
}

.confirm-btn-no:active {
    background-color: #e2e8e4;
    transform: scale(0.97);
}

.confirm-btn-yes:active {
    background-color: #007649;
    transform: scale(0.97);
}

/* Dashboard Launcher Page Styling */
.app-container.dashboard-bg {
    background-color: #031410; /* Very dark slate green/black */
    color: #ffffff;
}

.dashboard-header {
    align-items: center;
    padding-bottom: 8px;
}

.dashboard-title {
    font-size: 26px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-align: center;
}

.clock-section-container {
    padding: 0 24px;
    margin-bottom: 24px;
    z-index: 10;
}

.dashboard-clock-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 22px 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.clock-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.dashboard-time {
    font-family: var(--font-numbers);
    font-size: 46px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.dashboard-date {
    font-family: var(--font-numbers);
    font-size: 16px;
    font-weight: bold;
    color: #00ff88; /* Accent green-cyan date */
    letter-spacing: 1px;
}

.dashboard-main-content {
    flex: 1;
    background-color: #004d33; /* Dark green main container background */
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}

.section-title {
    font-size: 19px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 18px;
    letter-spacing: 0.2px;
}

.dashboard-user-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-row-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 16px 20px;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.user-row-btn:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.user-row-btn:active {
    transform: scale(0.98);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.user-row-name {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.1px;
    text-transform: capitalize;
}

.user-row-id {
    font-family: var(--font-numbers);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.2px;
}

.user-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}

.user-status-badge.status-completed {
    background-color: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.user-status-badge.status-pending {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-completed .badge-status-dot {
    background-color: #00ff88;
}

.status-pending .badge-status-dot {
    background-color: #ff4d4d;
}

.loading-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    padding: 20px 0;
}

/* Home Indicator bar for iOS phone simulation */
.home-indicator-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    z-index: 105;
    pointer-events: none;
}

.bottom-sheet.active ~ .home-indicator-bar {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Responsiveness: Full Screen on Mobile Devices */
@media (max-width: 600px) {
    body {
        background: var(--phone-bg);
    }
    
    .app-container {
        max-width: 100vw;
        height: 100vh;
        box-shadow: none;
    }
    
    .app-header {
        padding-top: 24px;
    }
    
    .home-indicator-bar {
        display: none;
    }
}
