/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Layout */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Screen */
.error-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.error-container h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #f44336;
}

.error-container p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.retry-btn {
    padding: 12px 24px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background-color: #1976D2;
}

/* Authentication Screen */
.auth-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-container h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2196F3;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    font-size: 18px;
}

.google-btn {
    background-color: #4285f4;
    color: white;
}

.google-btn:hover {
    background-color: #357ae8;
}

.telegram-btn {
    background-color: #0088cc;
    color: white;
}

.telegram-btn:hover {
    background-color: #006ba6;
}

.line-btn {
    background-color: #00c300;
    color: white;
}

.line-btn:hover {
    background-color: #00a000;
}

.phone-btn {
    background-color: #ff6b35;
    color: white;
}

.phone-btn:hover {
    background-color: #e55a2b;
}

/* Dashboard Screen */
.dashboard-container {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    color: #2196F3;
    font-size: 2rem;
}

.sign-out-btn {
    padding: 8px 16px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.sign-out-btn:hover {
    background-color: #d32f2f;
}

/* Balance Section */
.balance-section {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.balance-section h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: bold;
}

/* Referral Section */
.referral-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.referral-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.referral-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.referral-code {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #2196F3;
    border: 2px solid #e0e0e0;
    flex: 1;
}

.copy-btn {
    padding: 12px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.copy-btn:hover {
    background-color: #1976D2;
}

.referral-link-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.referral-link-display a {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #2196F3;
    border: 2px solid #e0e0e0;
    flex: 1;
    word-break: break-all;
}

.share-btn {
    padding: 12px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.share-btn:hover {
    background-color: #388E3C;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.action-btn:hover {
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Recent Activity */
.recent-activity {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.recent-activity h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Screen Container (for other screens) */
.screen-container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.screen-header {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.back-btn {
    padding: 8px 12px;
    background: none;
    border: none;
    color: #2196F3;
    cursor: pointer;
    font-size: 16px;
    margin-right: 15px;
}

.back-btn:hover {
    background-color: #e3f2fd;
    border-radius: 6px;
}

.screen-header h1 {
    color: #333;
    font-size: 1.5rem;
}

/* Quests Styles */
.quests-container {
    padding: 25px;
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quest-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #2196F3;
    transition: all 0.3s ease;
}

.quest-card.completed {
    border-left-color: #4CAF50;
    background: #e8f5e8;
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quest-header h3 {
    color: #333;
    font-size: 1.1rem;
}

.quest-reward {
    background: #2196F3;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.quest-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.quest-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2196F3;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    min-width: 60px;
}

.quest-completed {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.quest-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.download-btn, .social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.download-btn {
    background-color: #2196F3;
    color: white;
}

.download-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.social-btn {
    background-color: #4CAF50;
    color: white;
}

.social-btn:hover {
    background-color: #388E3C;
    transform: translateY(-1px);
}

/* Referrals Styles */
.referrals-container {
    padding: 25px;
}

.referrals-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.referral-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-email {
    font-size: 0.9rem;
    color: #666;
}

.referral-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

.joined-date {
    font-size: 0.8rem;
    color: #666;
}

/* Transactions Styles */
.transactions-container {
    padding: 25px;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-description {
    font-weight: 500;
    color: #333;
}

.transaction-date {
    font-size: 0.9rem;
    color: #666;
}

.transaction-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.transaction-amount.positive {
    color: #4CAF50;
}

.transaction-amount.negative {
    color: #f44336;
}

/* Withdrawal Styles */
.withdrawal-container {
    padding: 25px;
}

.withdrawal-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.withdrawal-status h3 {
    color: #333;
    margin-bottom: 15px;
}

.withdrawal-status p {
    margin-bottom: 8px;
    color: #666;
}

.withdrawal-status .eligible {
    color: #4CAF50;
    font-weight: 500;
}

.withdrawal-status .not-eligible {
    color: #f44336;
    font-weight: 500;
}

.withdrawal-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    text-align: center;
}

.withdrawal-form h3 {
    color: #333;
    margin-bottom: 15px;
}

.withdrawal-form p {
    color: #666;
    margin-bottom: 8px;
}

.withdraw-btn {
    margin-top: 20px;
    padding: 15px 30px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.withdraw-btn:hover {
    background-color: #1976D2;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 15px;
    }
    
    .auth-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .dashboard-container {
        margin: 20px;
        padding: 20px;
    }
    
    .auth-btn {
        padding: 18px 20px;
        font-size: 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .balance-amount {
        font-size: 2rem;
    }
    
    .referral-code-display,
    .referral-link-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .referral-code,
    .referral-link-display a {
        text-align: center;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-btn {
        padding: 15px;
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
    
    .quest-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .referral-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .referral-status {
        align-items: flex-start;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .transaction-amount {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin: 10px;
        padding: 25px 15px;
    }
    
    .auth-container h1 {
        font-size: 1.5rem;
    }
    
    .auth-btn {
        padding: 16px 15px;
        font-size: 15px;
    }
    
    .dashboard-container {
        margin: 10px;
        padding: 15px;
    }
    
    .balance-section {
        padding: 20px;
    }
    
    .balance-amount {
        font-size: 1.8rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .screen-container {
        margin: 10px;
    }
    
    .screen-header {
        padding: 15px 20px;
    }
    
    .quests-container,
    .referrals-container,
    .transactions-container,
    .withdrawal-container {
        padding: 20px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}