:root {
    --primary-color: #4a6bff;
    --secondary-color: #f5f7ff;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 70px; /* Space for bottom nav */
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), #6a5acd);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.wallet-balance {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 1rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.quick-action {
    background: white;
    border-radius: 10px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quick-action i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.quick-action span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Service Categories */
.service-categories {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Service Options */
.services-container {
    margin-top: 1rem;
}

.service-category {
    display: none;
}

.service-category.active {
    display: block;
}

.service-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.service-option {
    background: white;
    border-radius: 10px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.service-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.service-option i {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.service-option span {
    font-weight: 500;
}

/* Transactions */
.transactions-list {
    margin-top: 1rem;
}

.transaction-item {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.transaction-icon i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.transaction-details p {
    font-size: 0.8rem;
    color: var(--light-text);
}

.transaction-amount {
    font-weight: 600;
}

.transaction-amount.success {
    color: var(--success-color);
}

/* Account Section */
.account-info {
    text-align: center;
    margin-top: 1rem;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.user-avatar i {
    font-size: 3.5rem;
    color: var(--primary-color);
}

.account-info h3 {
    margin-bottom: 0.5rem;
}

.account-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-size: 1rem;
}

.account-btn:hover {
    background: var(--secondary-color);
}

.account-btn i {
    color: var(--primary-color);
}

.account-btn.logout {
    border-color: var(--error-color);
    color: var(--error-color);
}

.account-btn.logout i {
    color: var(--error-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.75rem;
    flex: 1;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    padding: 1.5rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
}

.modal h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #3a5bef;
}

/* Confirmation Modal */
.confirmation-content {
    text-align: center;
    padding: 1rem;
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.confirm-message {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.transaction-details {
    text-align: left;
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item span:first-child {
    color: var(--light-text);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    width: 90%;
    max-width: 300px;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-options {
        grid-template-columns: 1fr;
    }
    
    .bottom-nav {
        padding: 0.6rem 0;
    }
    
    .nav-item {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 1.4rem;
        margin-bottom: 0;
    }
}

/* Landscape Orientation */
@media (max-height: 480px) and (orientation: landscape) {
    .bottom-nav {
        padding: 0.4rem 0;
    }
    
    .nav-item span {
        display: none;
    }
}

/* iOS Safe Areas */
@supports (padding: max(0px)) {
    body {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .bottom-nav {
        padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
    }
}