/* ==============================================
   INFLUENCER MARKET - MOBILE APP DESIGN
   Mobile-First • App-Like Experience • Touch-Optimized
   ============================================== */

:root {
    /* App Colors - Modern Blue & Gray Theme */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Success/Warning/Error Backgrounds */
    --success-bg: #d1fae5;
    --warning-bg: #fef3c7;
    --error-bg: #fee2e2;
    --info-bg: #dbeafe;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows - Subtle for mobile */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    /* Spacing - Mobile optimized */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Layout */
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom);
}

/* ==============================================
   RESET & BASE
   ============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
}

/* ==============================================
   MOBILE APP HEADER
   ============================================== */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: var(--space-4);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Logo - Desktop Only */
.header-logo {
    display: none;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.125rem;
}

.header-logo-text {
    white-space: nowrap;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Desktop Navigation - Hidden on Mobile */
.desktop-nav {
    display: none;
    align-items: center;
    gap: var(--space-1);
}

.desktop-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.desktop-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.desktop-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--error);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.desktop-only {
    display: none;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-icon-btn:active {
    background: var(--bg-tertiary);
    transform: scale(0.95);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.wallet-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--success-bg);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: #065f46;
}

/* ==============================================
   BOTTOM NAVIGATION (Mobile App Style)
   ============================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: var(--safe-area-bottom);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: var(--space-2) 0;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: var(--transition);
    position: relative;
    min-width: 64px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
}

.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(12px);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--error);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==============================================
   MAIN CONTENT AREA
   ============================================== */

main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    padding: var(--space-4);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ==============================================
   CARDS - App Style
   ============================================== */

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-4);
}

.card-compact {
    padding: var(--space-3);
}

.card-hover {
    transition: var(--transition);
}

.card-hover:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==============================================
   BUTTONS - Touch Optimized
   ============================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: 0 var(--space-5);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-outline:active {
    background: var(--bg-tertiary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    min-height: 36px;
    padding: 0 var(--space-4);
    font-size: 0.875rem;
}

.btn-lg {
    min-height: 56px;
    padding: 0 var(--space-6);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ==============================================
   STATS CARDS - Mobile Optimized
   ============================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==============================================
   BADGES & CHIPS
   ============================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.5;
}

.badge-success {
    background: var(--success-bg);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.badge-error {
    background: var(--error-bg);
    color: #991b1b;
}

.badge-info {
    background: var(--info-bg);
    color: #1e40af;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

/* ==============================================
   FORMS - Touch Friendly
   ============================================== */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-control,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    -webkit-appearance: none;
}

.form-control:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==============================================
   LISTS & ITEMS
   ============================================== */

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    transition: var(--transition);
}

.list-item:active {
    background: var(--bg-tertiary);
    transform: scale(0.98);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-tertiary);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==============================================
   AVATAR
   ============================================== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* ==============================================
   ALERTS
   ============================================== */

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    display: flex;
    align-items: start;
    gap: var(--space-3);
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
}

.alert-error {
    background: var(--error-bg);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
}

/* ==============================================
   DIVIDER
   ============================================== */

.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-4) 0;
}

/* ==============================================
   SECTION HEADER
   ============================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-action {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* ==============================================
   EMPTY STATE
   ============================================== */

.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.empty-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ==============================================
   UTILITIES
   ============================================== */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }

/* ==============================================
   GRID SYSTEM - Mobile First
   ============================================== */

.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Card Variations */
.card-highlight {
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-4);
}

.card-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Table Container for Desktop */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg-tertiary);
}

table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
}

table tr:hover {
    background: var(--bg-secondary);
}

/* Text Muted */
.text-muted {
    color: var(--text-secondary);
}

/* ==============================================
   TABLET & DESKTOP (min-width: 768px)
   ============================================== */

@media (min-width: 768px) {
    :root {
        --header-height: 64px;
        --bottom-nav-height: 0px;
    }

    body {
        padding-bottom: 0;
    }

    main {
        padding: var(--space-6);
    }

    /* Show Desktop Elements */
    .header-logo {
        display: flex;
    }

    .header-title {
        display: none;
    }

    .desktop-nav {
        display: flex;
    }

    .desktop-only {
        display: inline-flex !important;
    }

    /* Hide Mobile Elements */
    .mobile-only {
        display: none !important;
    }

    .bottom-nav {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-4);
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        padding: var(--space-6);
    }
}

/* ==============================================
   DESKTOP (min-width: 1024px)
   ============================================== */

@media (min-width: 1024px) {
    .header-content {
        padding: 0 var(--space-6);
    }

    main {
        padding: var(--space-8) var(--space-6);
    }
}

/* ==============================================
   ANIMATIONS
   ============================================== */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

/* ==============================================
   LOADING STATES
   ============================================== */

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==============================================
   SIDEBAR (for desktop fallback)
   ============================================== */

.sidebar {
    display: none;
}

@media (min-width: 768px) {
    .sidebar {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: -280px;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background: var(--bg-primary);
        border-right: 1px solid var(--border-color);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 90;
    }

    .sidebar.active {
        left: 0;
    }
}
