* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Container */
.modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
    position: relative;
    text-decoration: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

      .link-button {
            display: inline-block;
            padding: 12px 24px;
            background-color: #6ba1db;
            color: white;
            text-decoration: none;
            border-radius: 20px;
            font-weight: 500;
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
            font-size: 20px;
            justify-content: center;
        }
        
        .link-button:hover {
            background-color: #142e49;
            transform: translateY(2px);
            box-shadow: 0 4px 8px rgba(12, 47, 85, 0.3);
        }
        
        .link-button:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
        }
/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Content */
.modal-content {
    padding: 32px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb #f9fafb;
    
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f9fafb;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

/* Tab Toggle */
.tab-toggle {
    display: flex;
    background: #f8fafc;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
    position: relative;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.tab.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab:hover:not(.active) {
    color: #334155;
}

/* Wallet Grid */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.wallet {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.wallet::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.1), transparent);
    transition: left 0.6s;
}

.wallet:hover {
    border-color: #4f46e5;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.15);
}

.wallet:hover::before {
    left: 100%;
}

.wallet-featured {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    position: relative;
}

.wallet-featured::after {
    content: 'POPULAR';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.wallet span {
    margin-top: 12px;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    text-align: center;
}

.wallet a {
    text-decoration: none;
    color: inherit;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-dot.active {
    background: #4f46e5;
    transform: scale(1.2);
}

.page-dot:hover {
    background: #64748b;
}

/* QR Code View */
.qr-code {
    text-align: center;
    display: none;
}

.qr-code.active {
    display: block;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    margin: 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
}

/* Form Container */
.form-container {
    display: none;
    animation: slideInRight 0.4s ease-out;
}

.form-container.active {
    display: block;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-btn {
    background: #f1f5f9;
    border: none;
    color: #475569;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #e2e8f0;
    transform: translateX(-4px);
}

.security-notice {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
}

.security-notice strong {
    color: #14532d;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.submit-btn:hover::before {
    left: 100%;
}

/* Success Message */
#successMessage {
    text-align: center;
    padding: 40px 20px;
}

#successMessage h3 {
    color: #059669;
    margin-bottom: 16px;
    font-size: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .modal {
        max-width: 100%;
        max-height: calc(100vh - 80px);
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px 24px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .wallet-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .wallet {
        padding: 16px 12px;
    }
    
    .wallet span {
        font-size: 12px;
        margin-top: 8px;
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 5px;
        padding-top: 20px;
    }
    
    .modal {
        border-radius: 12px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .wallet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .wallet {
        padding: 14px 10px;
    }
    
    .tab-toggle {
        margin-bottom: 24px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .qr-placeholder {
        width: 160px;
        height: 160px;
    }
    
    .back-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 320px) {
    .wallet-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .wallet span {
        font-size: 11px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .tab-toggle {
        background: #334155;
    }
    
    .tab {
        color: #94a3b8;
    }
    
    .tab.active {
        background: #475569;
        color: #e2e8f0;
    }
    
    .wallet {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .wallet:hover {
        border-color: #6366f1;
    }
    
    .qr-placeholder {
        background: #334155;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .back-btn {
        background: #475569;
        color: #e2e8f0;
    }
    
    .back-btn:hover {
        background: #64748b;
    }
}

/* Loading states */
.wallet.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wallet.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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

/* Accessibility improvements */
.wallet:focus,
.tab:focus,
.close-btn:focus,
.back-btn:focus,
.submit-btn:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}