/* ============================================
   LINK FLOW - Main Stylesheet
   ============================================ */

:root {
    --primary: #6c63ff;
    --primary-dark: #5a52d5;
    --primary-light: #8b85ff;
    --secondary: #4facfe;
    --accent: #f093fb;
    --success: #00b09b;
    --warning: #f6d365;
    --danger: #f64f59;
    --dark: #1a1a2e;
    --dark-2: #16213e;
    --dark-3: #0f3460;
    --text-muted: #8a8fa3;
    --card-bg: #ffffff;
    --card-border: rgba(108, 99, 255, 0.1);
    --sidebar-width: 260px;
    --topbar-height: 65px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 20px rgba(108, 99, 255, 0.12);
    --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --card-bg: #1e2035;
    --card-border: rgba(108, 99, 255, 0.2);
    --bs-body-bg: #161728;
    --bs-body-color: #c8cde4;
    --bs-card-bg: #1e2035;
    --bs-border-color: rgba(255,255,255,0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2ff;
    color: #333;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

[data-theme="dark"] body {
    background: #161728;
    color: #c8cde4;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

.btn { border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

/* ---- Gradient Utilities ---- */
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)) !important; }
.bg-gradient-success { background: linear-gradient(135deg, #00b09b, #96c93d) !important; }
.bg-gradient-warning { background: linear-gradient(135deg, #f6d365, #fda085) !important; }
.bg-gradient-danger  { background: linear-gradient(135deg, #f64f59, #c471ed) !important; }
.bg-gradient-info    { background: linear-gradient(135deg, #4facfe, #00f2fe) !important; }
.bg-gradient-dark    { background: linear-gradient(135deg, #1a1a2e, #16213e) !important; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--card-bg);
}
.card:hover { box-shadow: var(--shadow-lg); }

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.card-header {
    border-bottom: 1px solid var(--card-border);
    background: transparent;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; margin: 0; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.85; margin-top: 0.25rem; }
.stat-card .stat-change {
    font-size: 0.78rem;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800; color: white;
    flex-shrink: 0;
}
.sidebar-brand .brand-text { color: #fff; font-size: 1.1rem; font-weight: 700; }
.sidebar-brand .brand-text span { color: var(--secondary); }

.sidebar-section { padding: 0.5rem 0; }
.sidebar-label {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.sidebar .nav-link {
    padding: 0.65rem 1.5rem;
    color: rgba(255,255,255,0.65);
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.9rem;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
}
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(79,172,254,0.15));
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 0 3px 3px 0;
}
.sidebar .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .badge-count {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 20px;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
[data-theme="dark"] .topbar { background: var(--dark-2); border-color: rgba(255,255,255,0.06); }

.topbar .topbar-toggler {
    background: none; border: none; padding: 8px;
    border-radius: var(--radius-sm);
    color: inherit; cursor: pointer;
    transition: var(--transition);
}
.topbar .topbar-toggler:hover { background: rgba(108,99,255,0.1); }

/* ---- Main Content ---- */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; }
.main-content { padding: 1.5rem; }

@media (max-width: 991.98px) {
    .main-wrapper { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay { display: block !important; }
}

/* ---- Offer Cards ---- */
.offer-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
}
.offer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.offer-card .offer-image {
    height: 140px; object-fit: cover; width: 100%;
    background: linear-gradient(135deg, #f0f2ff, #e8ecff);
}
.offer-card .offer-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.offer-card .offer-coins {
    font-size: 1.4rem; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.offer-card .offer-network {
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted);
}
.offer-card .btn-complete {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; width: 100%;
    padding: 0.6rem; border-radius: var(--radius-sm);
    font-weight: 600; transition: var(--transition);
}
.offer-card .btn-complete:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---- Leaderboard ---- */
.leaderboard-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    transition: var(--transition);
}
.leaderboard-item:hover { background: rgba(108,99,255,0.05); }
.leaderboard-rank {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #a8a8a8); color: white; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #a0642a); color: white; }
.rank-other { background: rgba(108,99,255,0.15); color: var(--primary); }

/* ---- Withdraw Card ---- */
.withdraw-method {
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer; transition: var(--transition);
    text-align: center;
}
.withdraw-method:hover, .withdraw-method.selected, .withdraw-method.active {
    border-color: var(--primary);
    background: rgba(108,99,255,0.1);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.withdraw-method .method-icon {
    width: 56px; height: 56px; border-radius: 50%;
    margin: 0 auto 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700;
}

/* ---- Notification Bell ---- */
.notification-bell { position: relative; }
.notification-bell .badge-dot {
    position: absolute; top: 0; right: 0;
    width: 10px; height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%; max-width: 440px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2.5rem;
    color: #fff;
}
.auth-card .form-control {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff; border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}
.auth-card .form-control::placeholder { color: rgba(255,255,255,0.4); }
.auth-card .form-control:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    color: #fff; box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}
.auth-card .form-label { color: rgba(255,255,255,0.75); font-size: 0.85rem; }
.auth-card .btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none; width: 100%; padding: 0.8rem;
    font-weight: 600; border-radius: var(--radius-sm);
    color: white; font-size: 1rem;
    transition: var(--transition);
}
.auth-card .btn-primary-gradient:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108,99,255,0.4); }
.auth-particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; pointer-events: none; z-index: 0;
}
.particle {
    position: absolute; border-radius: 50%;
    background: var(--primary); opacity: 0.1;
    animation: float 15s infinite linear;
}
@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(720deg); }
}

/* ---- Tables ---- */
.table-responsive { border-radius: var(--radius-sm); overflow: hidden; }
.table th {
    font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--card-border);
    color: var(--text-muted);
}
[data-theme="dark"] .table { color: var(--bs-body-color); }
[data-theme="dark"] .table th, [data-theme="dark"] .table td { border-color: rgba(255,255,255,0.06); }

/* ---- Progress Bar ---- */
.progress { border-radius: 20px; height: 8px; }
.progress-bar { border-radius: 20px; }

/* ---- Badges ---- */
.badge { font-weight: 500; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--card-border);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: #c8cde4;
}

/* ---- Coin Wallet Widget ---- */
.wallet-widget {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius); padding: 1.5rem; color: white;
    position: relative; overflow: hidden;
}
.wallet-widget::before {
    content: '';
    position: absolute; top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.08); border-radius: 50%;
}
.wallet-balance { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; }

/* ---- Landing/Home Page ---- */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    min-height: 100vh; color: white;
    display: flex; align-items: center;
    position: relative; overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(108,99,255,0.2) 0%, transparent 60%),
                radial-gradient(ellipse at 30% 80%, rgba(79,172,254,0.15) 0%, transparent 60%);
}
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1; }
.hero-subtitle { font-size: 1.2rem; opacity: 0.85; margin: 1.5rem 0; }
.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none;
    padding: 1rem 2.5rem; border-radius: 50px;
    font-size: 1.1rem; font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 8px 30px rgba(108,99,255,0.4);
}
.btn-hero-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(108,99,255,0.5); color: white; }
.btn-hero-secondary {
    background: rgba(255,255,255,0.1);
    color: white; border: 2px solid rgba(255,255,255,0.3);
    padding: 1rem 2.5rem; border-radius: 50px;
    font-size: 1.1rem; font-weight: 600;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.15); color: white; transform: translateY(-3px); }

.feature-icon-wrap {
    width: 70px; height: 70px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.8rem;
}

.earn-step { text-align: center; padding: 1.5rem; }
.earn-step .step-num {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-size: 1.4rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 6px 20px rgba(108,99,255,0.3);
}

/* ---- Floating Coins Animation ---- */
@keyframes coinFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}
.coin-float { animation: coinFloat 3s ease-in-out infinite; }
.coin-float-delay { animation: coinFloat 3s ease-in-out 1.5s infinite; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- Loading Spinner ---- */
.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

/* ---- Copy Button ---- */
.copy-btn {
    cursor: pointer; transition: var(--transition);
    border-radius: var(--radius-sm);
}
.copy-btn:hover { transform: scale(1.05); }
.copy-btn.copied { background: var(--success); color: white; }

/* ---- Dark Mode Toggle ---- */
.theme-toggle {
    width: 44px; height: 24px;
    background: rgba(108,99,255,0.2);
    border-radius: 12px; position: relative;
    cursor: pointer; transition: var(--transition);
    border: 2px solid rgba(108,99,255,0.3);
}
.theme-toggle.active { background: var(--primary); }
.theme-toggle::after {
    content: '';
    position: absolute; top: 1px; left: 1px;
    width: 18px; height: 18px;
    background: white; border-radius: 50%;
    transition: var(--transition);
}
.theme-toggle.active::after { transform: translateX(20px); }

/* ---- Admin Sidebar ---- */
.admin-sidebar { background: linear-gradient(180deg, #1a1a2e, #0f3460); }
.admin-topbar { background: white; }
[data-theme="dark"] .admin-topbar { background: #1e2035; }

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
    .stat-card .stat-value { font-size: 1.6rem; }
    .hero-title { font-size: 2.2rem; }
    .main-content { padding: 1rem; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .wallet-balance { font-size: 2rem; }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,0.4); }
    50% { box-shadow: 0 0 20px 8px rgba(108,99,255,0.2); }
}

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.fade-in-up-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-up-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-up-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-up-4 { animation-delay: 0.4s; opacity: 0; }

.pulse-glow { animation: pulse-glow 2s infinite; }

/* ---- Alert styles ---- */
.alert { border: none; border-radius: var(--radius-sm); }
.alert-success { background: rgba(0,176,155,0.1); color: #00b09b; border-left: 4px solid #00b09b; }
.alert-danger  { background: rgba(246,79,89,0.1);  color: #c0392b; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(246,211,101,0.1); color: #d68910; border-left: 4px solid #f6d365; }
.alert-info    { background: rgba(79,172,254,0.1);  color: #1a6eb5; border-left: 4px solid var(--secondary); }

/* ---- URL Shortener ---- */
.short-url-input {
    font-size: 1rem; font-weight: 600;
    background: rgba(108,99,255,0.05);
    border: 2px solid rgba(108,99,255,0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}
