/* Dashboard Styles - Mobile App Style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Remove default focus outline and add custom rounded focus styles */
* {
    -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: inherit;
}

/* Ensure all content containers have padding for bottom nav */
.app-container > *:not(.bottom-nav) {
    position: relative;
}

/* Common padding for content areas - apply to all pages with bottom nav */
.app-container .main-content,
.app-container .help-content,
.app-container .profile-section,
.app-container .leaderboard-content,
.app-container .voucher-content {
    padding-bottom: 90px; /* Space for floating bottom nav (60px nav + 12px bottom + 18px padding) */
}

/* Exclude small content elements and shop page sections from min-height rule */
.app-container .step-content,
.app-container .policy-text,
.app-container .guide-step,
.app-container .transaction-info,
.app-container .link-form-section,
.app-container .guide-section {
    padding-bottom: 20;
    min-height: auto;
}

/* Modern card style - apply to all white cards */
.app-container [class*="section"],
.app-container [class*="card"],
.app-container [class*="Section"],
.app-container [class*="Card"] {
    border-radius: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* Modern input style */
.app-container input[type="text"],
.app-container input[type="email"],
.app-container input[type="password"],
.app-container input[type="number"],
.app-container textarea,
.app-container select {
    border-radius: 20px !important;
    transition: all 0.2s ease;
}

.app-container input:focus,
.app-container textarea:focus,
.app-container select:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
}

/* Modern button style */
.app-container button:not(.nav-item):not(.close),
.app-container .btn:not(.nav-item) {
    border-radius: 24px !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.app-container button:hover:not(.nav-item):not(.close),
.app-container .btn:hover:not(.nav-item) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    background: #f8f9fa;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
    padding-bottom: 90px; /* Space for floating bottom navigation */
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    padding-top: 40px;
    color: white;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
}

.header-content {
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gift-icon {
    position: relative;
    font-size: 24px;
}

.gift-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
}

.coins-display {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.coins-amount {
    font-weight: bold;
}

/* Search Bar */
.search-container {
    background: white;
    border-radius: 28px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.search-container i {
    color: #999;
}

.search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 16px;
    color: #333;
}

/* Main Content */
.main-content {
    padding: 20px;
    padding-bottom: 90px; /* Space for floating bottom nav */
}

/* Welcome Offer Card */
.welcome-offer-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.offer-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.offer-title {
    color: #999;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.offer-content h4 {
    color: #333;
    font-size: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.reward-badge {
    margin-left: auto;
    background: #FFC107;
    color: white;
    padding: 6px 12px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
}

.offer-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.stat-item i {
    color: #667eea;
}

/* Wallet Stats */
.wallet-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stat-card i {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stat-period {
    font-size: 10px;
    color: #999;
}

/* Deals Section */
.deals-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.see-more {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Platform Cards */
.platform-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.platform-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.06);
}

.platform-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.platform-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.shopee-icon {
    background: #FF6F61;
}

.walmart-icon {
    background: #FFC107;
}

.google-icon {
    background: #4285F4;
}

.priceline-icon {
    background: #00BFA5;
}

.tiktok-icon {
    background: #000;
}

.lazada-icon {
    background: #0F146D;
}

.cashback-badge {
    position: absolute;
    bottom: 8px;
    font-size: 10px;
    color: #666;
    font-weight: bold;
}

/* Sales Section */
.sales-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.sales-header {
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.new-deals-badge {
    background: #FF6B6B;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.deals-count {
    background: rgba(255,255,255,0.3);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Bottom Navigation - Modern Pill Style */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 390px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom) + 8px); /* Extra space for home indicator */
    border-radius: 30px; /* Pill shape with rounded corners */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); /* Soft shadow for floating effect */
    z-index: 1000;
    min-height: 60px;
    box-sizing: border-box;
}

/* Home Indicator Bar */
.bottom-nav::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
    opacity: 0.6;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: #333;
    padding: 8px 12px;
    transition: all 0.2s ease;
    border-radius: 12px;
    flex: 1;
    min-width: 0;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item i {
    font-size: 22px;
    transition: transform 0.2s ease;
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item.deal-center {
    position: relative;
    flex: 0 0 auto;
    margin: 0 8px;
}

.deal-nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ECDC4 0%, #667eea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    transition: transform 0.2s ease;
}

.nav-item.deal-center.active .deal-nav-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.6);
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.withdrawal-form {
    margin-top: 20px;
}

.withdrawal-form label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.withdrawal-form input,
.withdrawal-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 430px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .bottom-nav {
        max-width: calc(100% - 40px);
        width: calc(100% - 40px);
    }
}
