:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --card-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wallet-balance {
    background: var(--surface-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Cards */
.card {
    background: var(--card-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--card-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--surface-color);
}

.product-content {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--card-color);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--surface-color);
    font-weight: 600;
    color: var(--text-secondary);
}

.table td {
    color: var(--text-primary);
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-color);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

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

.modal-content {
    background: var(--card-color);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

/* Footer */
.footer {
    background: var(--surface-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }
    
    .nav-links.mobile-open {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }
    
    .user-menu {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .wallet-balance {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
        flex: 1;
        text-align: center;
        margin-right: 0.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    /* Quick Actions responsive */
    .flex.flex-center.gap-2 {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .flex.flex-center.gap-2 .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Form improvements */
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .table-container {
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 500px;
    }
    
    .modal-content {
        padding: 1.25rem;
        width: 95%;
        margin: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    /* Better touch targets */
    .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .nav-links a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    /* KYC Form Mobile */
    .kyc-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Wallet Mobile */
    .wallet-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .withdrawal-form {
        max-width: 100%;
    }
    
    /* Table Mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Additional Mobile Fixes */
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-subtitle {
        font-size: 0.9rem;
    }
    
    /* Better spacing for mobile forms */
    .form-input {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    /* Simplified mobile navigation */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        z-index: 1001;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.4rem;
    }
    
    .user-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-dark);
        padding: 1rem;
        justify-content: center;
        gap: 1rem;
        z-index: 998;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Mobile Hero Banner */
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .hero-features {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .feature-item {
        padding: 1rem !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .btn-hero {
        width: 80%;
        max-width: 300px;
    }
}

/* Hero Banner */
.hero-banner {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: none !important;
    background-attachment: fixed;
    position: relative;
    padding: 4rem 0 3rem 0;
    margin-bottom: 1.5rem;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent !important;
    background-image: none !important;
    opacity: 0;
    animation: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #ffffff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.hero-features {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.feature-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    width: 100%;
}

.feature-item::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.6s ease;
}

.feature-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.feature-item:hover::before {
    left: 100%;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-hero {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    min-width: 180px;
}

/* Feature Cards Visibility Fix */
.feature-text {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-align: center;
    line-height: 1.4;
    letter-spacing: 0.5px;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0;
}

.feature-emoji {
    font-size: 2.5rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    line-height: 1;
}

/* Force feature cards to show */
.hero-features .feature-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hero-features .feature-item * {
    visibility: visible !important;
    opacity: 1 !important;
}
