/* /assets/style.css (FINAL NAVIGATION SPACING FIX) */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;700&display=swap');

:root {
    --primary-color: #00B900;
    --secondary-color: #f7f7f7;
    --text-color: #333;
    --border-color: #e0e0e0;
    --background-color: #ffffff;
    --danger-color: #dc3545;
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.container {
    background-color: var(--background-color);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem auto;
    box-sizing: border-box;
}

#loading, #liff-error {
    padding: 2rem;
}

#registration-section, #main-section {
    display: none;
}

/* --- Typography --- */
h1, h2, h3, p {
    margin-top: 0;
}
h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}
h3 {
    text-align: left;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
p {
    color: #666;
    margin-bottom: 1.5rem;
    text-align: center;
}
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}


/* --- User Profile & Navigation --- */
.top-wrapper {
    margin-bottom: 1rem;
}
#user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--secondary-color);
    border-radius: 12px;
    text-align: left;
    margin: 0;
}
#user-profile img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
}
#user-info {
    flex-grow: 1;
    overflow: hidden;
}
#user-info #display-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#user-info #community-info {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-credit a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e9ecef;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s;
}
.profile-credit a:hover {
    background-color: #dde2e7;
}
.profile-credit span {
    font-size: 0.85rem;
    color: #666;
}
.profile-credit strong {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* ========================================== */
/* ===       CORRECTED NAVIGATION         === */
/* ========================================== */
.navigation-bar {
    text-align: center;
    margin-top: 1.5rem; /* <<< ADDED: Space from profile box */
    margin-bottom: 1rem; /* <<< REDUCED: Space to main title */
    font-size: 0.9rem;
}
.navigation-bar a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.navigation-bar a:hover {
    text-decoration: underline;
}
/* ------------------------------------------ */


/* --- Form & Buttons --- */
.form-group {
    text-align: left;
    margin-bottom: 1rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
input, select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
}
.btn {
    display: inline-block;
    text-decoration: none;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1.5rem;
    box-sizing: border-box;
}
.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: #00a300; }
.btn-secondary { background-color: #6c757d; }
.btn:disabled { background-color: #ccc; cursor: not-allowed; }
.btn-small { width: auto; padding: 0.5rem 1rem; font-size: 0.9rem; margin-top: 0; }


/* --- Responsive --- */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        min-height: 100vh;
    }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    #user-profile { padding: 0.8rem; gap: 0.8rem; }
    #user-profile img { width: 50px; height: 50px; }
    #user-info #display-name { font-size: 1.1rem; }
}

/* ... (All other specific styles like .wallet-balance-card, .order-summary-card etc. can be placed here) ... */
.round-card {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1rem;
}
.round-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    border-bottom: none;
    display: block;
}
.round-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    text-align: left;
}
.order-item-list, .history-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
}
.order-item-list li, .history-list li {
    background-color: #fdfdfd;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.order-item-list li:first-child, .history-list li:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.order-item-list li:last-child, .history-list li:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: none;
}
.item-details, .history-details {
    flex-grow: 1;
    overflow: hidden;
}
.item-details .item-name, .history-details strong {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-size: 1.1rem;
}
.item-details .item-price, .history-details small {
    color: #555;
    font-size: 0.9rem;
}
.price-pending {
    color: #ffc107;
    font-weight: bold;
}
.delete-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.delete-btn:hover {
    background-color: #c82333;
}
.round-status, .history-status {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: white;
    text-transform: capitalize;
    flex-shrink: 0;
}
.status-open { background-color: #28a745; }
.status-closed, .status-pending { background-color: #ffc107; }
.status-verifying { background-color: #17a2b8; }
.status-completed { background-color: #6c757d; }
.status-failed { background-color: #dc3545; }

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}
.wallet-balance-card {
    background: linear-gradient(135deg, #00B900, #008a00);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}
.wallet-balance-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}
.wallet-balance-card h2 {
    font-size: 2.5rem;
    margin: 0.5rem 0 0 0;
    color: white;
}
.wallet-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e9ecef;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.wallet-summary strong {
    font-size: 1.2rem;
    color: var(--primary-color);
}
.wallet-summary a {
    font-size: 0.9rem;
    font-weight: bold;
}
.order-summary-card {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1rem;
    padding: 1rem;
    text-align: left;
}
.order-summary-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.order-summary-card li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #ddd;
    font-size: 0.9rem;
}
.order-summary-card li:last-child {
    border-bottom: none;
}
.order-summary-card li span {
    color: #666;
}
.order-summary-card li strong {
    color: var(--text-color);
}
.order-summary-card li .savings {
    color: var(--primary-color);
}
.final-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}
.pay-btn.btn-warning {
    background-color: #ffc107;
    color: #333;
}
.fail-reason {
    color: var(--danger-color);
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}
.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}