/* =====================================================
   AdLinkFly Clone - Main Stylesheet
   ===================================================== */

:root {
  --primary: #6c63ff;
  --primary-dark: #5a52d5;
  --secondary: #ff6584;
  --success: #28c76f;
  --warning: #ff9f43;
  --danger: #ea5455;
  --info: #00cfe8;
  --dark: #1e1e2d;
  --dark2: #2a2a3c;
  --dark3: #3a3a52;
  --light: #f8f8ff;
  --gray: #6e6b7b;
  --border: rgba(255,255,255,0.08);
  --text: #d0d2db;
  --text-light: #b4b7bd;
  --sidebar-width: 260px;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--dark); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- Layout ---- */
.wrapper { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--dark2); position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.main-content { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }
.topbar { background: var(--dark2); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.page-body { padding: 28px 24px; }

/* ---- Sidebar ---- */
.sidebar-logo { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo a { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.sidebar-logo span { color: white; }
.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section { padding: 8px 20px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--text-light); font-size: 0.9rem; transition: all 0.2s; position: relative; }
.nav-item:hover, .nav-item.active { background: rgba(108,99,255,0.15); color: var(--primary); text-decoration: none; }
.nav-item.active::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--primary); border-radius:0 3px 3px 0; }
.nav-item svg { width:18px; height:18px; flex-shrink:0; }
.sidebar-user { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width:36px; height:36px; border-radius:50%; background:var(--primary); display:flex; align-items:center; justify-content:center; font-weight:700; color:white; font-size:0.9rem; flex-shrink:0; }
.sidebar-user .user-info { flex:1; overflow:hidden; }
.sidebar-user .user-name { font-size:0.85rem; font-weight:600; color:white; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user .user-bal { font-size:0.75rem; color:var(--success); }

/* ---- Cards ---- */
.card { background: var(--dark2); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h5 { font-size: 1rem; font-weight: 600; color: white; }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.1); }

/* ---- Stats Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--dark2); border-radius: var(--radius); padding: 22px; border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 26px; height: 26px; }
.stat-icon.purple { background: rgba(108,99,255,0.2); color: var(--primary); }
.stat-icon.green { background: rgba(40,199,111,0.2); color: var(--success); }
.stat-icon.orange { background: rgba(255,159,67,0.2); color: var(--warning); }
.stat-icon.red { background: rgba(234,84,85,0.2); color: var(--danger); }
.stat-icon.blue { background: rgba(0,207,232,0.2); color: var(--info); }
.stat-info h3 { font-size: 1.6rem; font-weight: 700; color: white; line-height: 1.2; }
.stat-info p { font-size: 0.8rem; color: var(--text-light); margin-top: 3px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-light); margin-bottom: 8px; }
.form-control { width: 100%; padding: 11px 14px; background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.9rem; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.form-control::placeholder { color: var(--gray); }
.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; white-space: nowrap; }
.form-text { font-size: 0.78rem; color: var(--gray); margin-top: 5px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: var(--dark3); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Alerts ---- */
.alert { padding: 14px 18px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid; }
.alert-success { background: rgba(40,199,111,0.1); border-color: rgba(40,199,111,0.3); color: #28c76f; }
.alert-danger { background: rgba(234,84,85,0.1); border-color: rgba(234,84,85,0.3); color: #ea5455; }
.alert-warning { background: rgba(255,159,67,0.1); border-color: rgba(255,159,67,0.3); color: #ff9f43; }
.alert-info { background: rgba(0,207,232,0.1); border-color: rgba(0,207,232,0.3); color: #00cfe8; }

/* ---- Tables ---- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th { padding: 12px 16px; text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tbody tr:hover td { background: rgba(108,99,255,0.05); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: rgba(40,199,111,0.15); color: var(--success); }
.badge-danger { background: rgba(234,84,85,0.15); color: var(--danger); }
.badge-warning { background: rgba(255,159,67,0.15); color: var(--warning); }
.badge-info { background: rgba(0,207,232,0.15); color: var(--info); }
.badge-secondary { background: rgba(110,107,123,0.2); color: var(--gray); }

/* ---- Interstitial Ad Page ---- */
.interstitial-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--dark); }
.interstitial-nav { background: var(--dark2); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.interstitial-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.interstitial-box { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; max-width: 600px; width: 100%; text-align: center; }
.interstitial-icon { width: 70px; height: 70px; border-radius: 50%; background: rgba(108,99,255,0.2); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.interstitial-icon svg { width: 36px; height: 36px; color: var(--primary); }
.interstitial-box h2 { color: white; font-size: 1.4rem; margin-bottom: 8px; }
.interstitial-box p { color: var(--text-light); margin-bottom: 24px; }
.timer-circle { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--primary); display: flex; align-items: center; justify-content: center; margin: 20px auto; font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.ad-container { background: var(--dark3); border: 1px dashed var(--border); border-radius: 8px; padding: 20px; margin: 20px 0; min-height: 100px; display: flex; align-items: center; justify-content: center; color: var(--gray); font-size: 0.85rem; }
#proceed-btn { display: none; }

/* ---- Homepage ---- */
.hero { padding: 80px 20px 60px; text-align: center; background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%); }
.hero h1 { font-size: 2.8rem; font-weight: 800; color: white; margin-bottom: 16px; line-height: 1.2; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto 32px; }
.hero-form { max-width: 700px; margin: 0 auto; }
.hero-form .input-group .form-control { padding: 16px 20px; font-size: 1rem; border-radius: 10px 0 0 10px; }
.hero-form .btn { padding: 16px 28px; font-size: 1rem; border-radius: 0 10px 10px 0; }
.features { padding: 70px 20px; background: var(--dark2); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; max-width: 1100px; margin: 0 auto; }
.feature-card { background: var(--dark3); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-align: center; }
.feature-icon { width: 56px; height: 56px; border-radius: 12px; background: rgba(108,99,255,0.15); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.feature-icon svg { width: 28px; height: 28px; color: var(--primary); }
.feature-card h4 { color: white; font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-light); font-size: 0.88rem; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { color: white; font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.section-header p { color: var(--text-light); font-size: 0.95rem; }

/* ---- Auth Pages ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--dark); }
.auth-box { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; max-width: 440px; width: 100%; }
.auth-logo { text-align: center; margin-bottom: 28px; font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.auth-box h2 { color: white; font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; text-align: center; }
.auth-box .subtitle { text-align: center; color: var(--gray); font-size: 0.88rem; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-light); font-size: 0.88rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ---- Shortener Result ---- */
.result-box { background: var(--dark3); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.result-url { flex: 1; font-size: 1rem; color: var(--primary); font-weight: 600; word-break: break-all; }
.copy-btn { white-space: nowrap; }

/* ---- Modals ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 999; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); max-width: 500px; width: 100%; padding: 28px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h5 { color: white; font-size: 1.05rem; }
.modal-close { background: none; border: none; color: var(--gray); cursor: pointer; font-size: 1.4rem; padding: 0; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn { padding: 7px 13px; background: var(--dark3); border: 1px solid var(--border); border-radius: 6px; color: var(--text-light); font-size: 0.85rem; text-decoration: none; transition: all 0.2s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); text-decoration: none; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ---- Responsive ---- */
.hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .page-body { padding: 20px 16px; }
  .overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
  .overlay.open { display: block; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .input-group { flex-direction: column; }
  .input-group .form-control { border-radius: 8px; }
  .input-group .btn { border-radius: 8px; }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-white { color: white; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.w-100 { width: 100%; } .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
