/* 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;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    color: #e6e6e6;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(26, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #2a3441;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    color: #ffd700;
}

.nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: #2a3441;
    border: 1px solid #3a4451;
    color: #e6e6e6;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-btn:hover {
    background: #3a4451;
    border-color: #4a90e2;
}

/* Main Content */
.main {
    padding: 30px 0;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 30px;
}

/* Progress Card */
.progress-card {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 1px solid #3a4451;
    border-radius: 16px;
    padding: 25px;
    margin: 0 auto 40px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.balance-info, .goal-info {
    text-align: center;
}

.balance-label, .goal-label {
    display: block;
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4ade80;
}

.goal-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffd700;
}

.progress-bar {
    background: #2a3441;
    border-radius: 10px;
    height: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: 1px solid #357abd;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #2a3441;
    color: #666;
    cursor: not-allowed;
}

.btn-secondary {
    background: #2a3441;
    color: #e6e6e6;
    border: 1px solid #3a4451;
}

.btn-secondary:hover {
    background: #3a4451;
    border-color: #4a90e2;
}

.btn-success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    border: 1px solid #22c55e;
}

.btn-success:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* Section Styles */
.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    color: #ffd700;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.back-btn {
    background: #2a3441;
    border: 1px solid #3a4451;
    color: #e6e6e6;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.back-btn:hover {
    background: #3a4451;
    border-color: #4a90e2;
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.market-card {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 2px solid #3a4451;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.market-card:hover {
    border-color: #4a90e2;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.2);
}

.market-flag {
    font-size: 3rem;
    margin-bottom: 15px;
}

.market-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffd700;
}

.market-desc {
    color: #b0b0b0;
    font-size: 0.95rem;
}

/* Category Grid */
.category-grid, .subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card, .subcategory-card {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 2px solid #3a4451;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-card:hover, .subcategory-card:hover {
    border-color: #4a90e2;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
}

.category-icon, .subcategory-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.category-name, .subcategory-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffd700;
}

.category-desc, .subcategory-desc {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Offers Grid */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.offer-card {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 2px solid #3a4451;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.offer-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
}

.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.offer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 5px;
}

.offer-payout {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.offer-desc {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.offer-actions {
    display: flex;
    gap: 10px;
}

.offer-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offer-btn-primary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

.offer-btn-primary:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
}

.offer-btn-secondary {
    background: #2a3441;
    color: #e6e6e6;
    border: 1px solid #3a4451;
}

.offer-btn-secondary:hover {
    background: #3a4451;
}

/* History Section */
.history-section {
    margin-top: 50px;
}

.history-list {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 1px solid #3a4451;
    border-radius: 12px;
    padding: 20px;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #b0b0b0;
}

.history-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #3a4451;
}

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

.history-info {
    flex: 1;
}

.history-title {
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 5px;
}

.history-desc {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.history-amount {
    font-weight: 600;
    color: #4ade80;
    font-size: 1.1rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 1px solid #3a4451;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #3a4451;
}

.modal-header h3 {
    color: #ffd700;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e6e6e6;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #3a4451;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e6e6e6;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: #2a3441;
    border: 1px solid #3a4451;
    border-radius: 8px;
    color: #e6e6e6;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-control {
    flex: 1;
}

/* Referral Stats */
.referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.stat {
    text-align: center;
    padding: 20px;
    background: #2a3441;
    border-radius: 8px;
    border: 1px solid #3a4451;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #4ade80;
    margin-bottom: 5px;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Help Steps */
.help-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    color: #ffd700;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.step-content p {
    color: #b0b0b0;
    line-height: 1.5;
}

/* Chatbot */
.chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: linear-gradient(135deg, #1a1f2e, #2a3441);
    border: 1px solid #3a4451;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.chatbot.active {
    display: flex;
}

.chatbot-header {
    padding: 15px 20px;
    border-bottom: 1px solid #3a4451;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    color: #ffd700;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    color: #e6e6e6;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    line-height: 1.4;
}

.bot-message {
    background: #2a3441;
    color: #e6e6e6;
    align-self: flex-start;
}

.user-message {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    align-self: flex-end;
}

.message-text {
    font-size: 0.9rem;
}

.chatbot-input {
    padding: 15px 20px;
    border-top: 1px solid #3a4451;
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 10px;
    background: #2a3441;
    border: 1px solid #3a4451;
    border-radius: 8px;
    color: #e6e6e6;
    font-size: 14px;
}

.chatbot-input input:focus {
    outline: none;
    border-color: #4a90e2;
}

.chatbot-input button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 20, 25, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #2a3441;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: #b0b0b0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .progress-card {
        padding: 20px;
    }
    
    .progress-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .progress-actions {
        flex-direction: column;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-grid, .subcategory-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .offers-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .referral-stats {
        grid-template-columns: 1fr;
    }
    
    .chatbot {
        width: 300px;
        height: 400px;
        bottom: 10px;
        right: 10px;
    }
    
    .help-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .welcome-title {
        font-size: 1.8rem;
    }
    
    .category-grid, .subcategory-grid {
        grid-template-columns: 1fr;
    }
    
    .chatbot {
        width: calc(100vw - 20px);
        height: 350px;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .market-card,
    .category-card,
    .subcategory-card,
    .offer-card {
        border-width: 3px;
    }
}

