:root {
    --primary-color: #03dd6d;
    --primary-gradient: linear-gradient(135deg, #03dd6d 0%, #02b056 100%);
    --bg-color: #f0f2f5;
    --text-color: #333;
    --text-light: #888;
    --danger-color: #ff4757;
    --app-width: 480px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: var(--app-width);
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    touch-action: pan-y;
    padding-bottom: 60px; /* Space for TabBar */
}

/* Tab Pages */
.tab-page {
    display: none;
    flex: 1;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-page.active {
    display: flex;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%; /* Center relative to viewport */
    transform: translateX(-50%); /* Center adjustment */
    right: auto; /* Remove right stretch */
    width: 100%;
    max-width: var(--app-width); /* Match app container width */
    height: 60px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 100;
}

.tab-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    flex: 1;
    height: 100%;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.tab-label {
    font-size: 0.75rem;
}

/* Map Styles */
#map {
    width: 100%;
    height: 100%;
    flex: 1;
}

#page-map {
    position: relative;
}

.map-controls {
    position: absolute;
    top: 20px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.range-control {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-self: flex-start;
    font-size: 0.9rem;
    color: var(--text-color);
}

.range-control input[type="range"] {
    width: 100px;
    accent-color: var(--primary-color);
}

.map-filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.map-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Header */
.header {
    padding: 30px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-container {
    text-align: left;
}

.wallet-address {
    font-size: 0.9rem;
    color: var(--text-light);
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 15px;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wallet-icon {
    width: 16px;
    height: 16px;
}

#date-display {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
}

#weekday-display {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* User Info */
.user-info {
    padding: 20px;
    text-align: left;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

#username {
    border: none;
    border-bottom: 2px solid #eee;
    font-size: 1.2rem;
    text-align: left;
    width: 150px;
    padding: 5px;
    outline: none;
    transition: border-color 0.3s;
    font-weight: bold;
    color: var(--primary-color);
}

.username-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    border-bottom: 2px solid transparent;
    padding: 5px;
}

#username:focus, #email:focus {
    border-bottom-color: var(--primary-color);
}

.prefix {
    font-size: 1.2rem;
    margin-right: 5px;
}

.contact-group {
    flex-direction: row;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.email-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

#email {
    margin-top: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 4px 8px;
    width: 180px;
    text-align: left;
    outline: none;
}

.email-text {
    color: var(--text-color);
    font-weight: 500;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 2px 5px;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.view {
    display: none;
    /* animation: fadeIn 0.5s ease; */ /* Remove this default */
    width: 100%;
    height: 100%; /* Ensure it takes full height */
}

.view.active {
    display: block;
}

/* Define animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.view.slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

.view.slide-in-left {
    animation: slideInLeft 0.3s ease-out forwards;
}

/* Sign In Button View */
#view-signin {
    text-align: center;
    padding-top: 20px;
}

.circle-btn-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#signin-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 25px rgb(75 162 104 / 40%);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

#signin-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Checked In State */
#signin-btn.checked-in {
    background: #e0e0e0;
    cursor: default;
    box-shadow: none;
    transform: none;
}

#signin-btn.checked-in .btn-text {
    color: #888;
}

.hint-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Calendar View */
#view-calendar {
    background: #fff;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-color);
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    border-radius: 50%;
    cursor: default;
}

.day.today {
    border: 2px solid var(--primary-color);
    font-weight: bold;
}

.day.signed-in {
    background: var(--primary-color);
    color: white;
    position: relative;
}

.day.signed-in::after {
    content: '✓';
    font-size: 0.6rem;
    position: absolute;
    bottom: 2px;
}

/* Bottom Alert */
.alert-info {
    padding: 15px 20px;
    background: #f8f8f8;
    color: #333;
    width: 90%;
    font-size: 0.8rem;
    margin: 2rem auto;
    border-radius: 10px;
    text-align: center;
    /* border-top: 1px solid #fee; */
}

/* Footer */
.footer {
    padding: 20px;
    background-color: #fafafa;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.85rem;
}

.links {
    margin-bottom: 10px;
}

.links a {
    color: var(--text-light);
    text-decoration: none;
}

.divider {
    margin: 0 10px;
    color: #ddd;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-link {
    color: var(--primary-color) !important;
    text-decoration: none;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-input-group {
    text-align: left;
    margin-bottom: 15px;
}

.modal-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.modal-input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    outline: none;
    font-size: 1rem;
}

.modal-input-group input:focus {
    border-color: var(--primary-color);
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.modal-btn:hover {
    opacity: 0.9;
}

/* About Page Styles */
.about-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.about-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(3, 221, 109, 0.3);
    object-fit: cover;
}

.about-logo h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.about-logo p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.about-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.05); */
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.list-item:hover {
    background-color: #f9f9f9;
}

.list-item .arrow {
    color: #ccc;
    font-family: monospace;
}

.scrollable {
    max-height: 80vh;
    overflow-y: auto;
}

.text-content {
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.donation-address {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    word-break: break-all;
    font-family: monospace;
}

.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #e0e0e0;
    transition: background-color 0.3s ease;
    display: block;
}

.dot.active {
    background-color: #03dd6d;
}
