/* =========================================================
   Instagram Takipçi Havuz Paneli — Ana Stil
   Font: Syne (display) + DM Sans (body)
   Tema: Koyu mor/siyah gradient, neon vurgu
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,400&display=swap');

:root {
    --bg-base:      #0a0a0f;
    --bg-card:      #13131c;
    --bg-card2:     #1a1a27;
    --bg-input:     #1f1f2e;
    --border:       #2a2a3d;
    --border-light: #35355a;

    --primary:      #7c5cfc;
    --primary-dim:  #5b3fd8;
    --primary-glow: rgba(124,92,252,.25);

    --accent:       #00e5c9;
    --accent-dim:   rgba(0,229,201,.15);

    --danger:       #ff4d6a;
    --warning:      #ffb938;
    --success:      #22d38a;
    --info:         #3ab6ff;

    --text-base:    #e8e8f0;
    --text-muted:   #8888aa;
    --text-dim:     #5555770;

    --radius-sm:    6px;
    --radius:       12px;
    --radius-lg:    18px;

    --sidebar-w:    260px;
    --topbar-h:     64px;

    --shadow-card:  0 4px 32px rgba(0,0,0,.45);
    --shadow-glow:  0 0 24px var(--primary-glow);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text-base);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6,
.font-display { font-family: 'Syne', sans-serif; }

/* ---- Auth pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,92,252,.18) 0%, transparent 70%),
                var(--bg-base);
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    font-family: 'Syne', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

/* ---- Layout ---- */
.panel-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    transition: transform .25s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem 1rem;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    display: block;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    transition: color .15s, background .15s;
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-base);
    background: rgba(255,255,255,.04);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-glow);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-link i { font-size: 1.1rem; opacity: .85; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ---- Main content ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar-actions { display: flex; align-items: center; gap: 1rem; }

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-glow);
    border: 1px solid rgba(124,92,252,.4);
    color: var(--primary);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Page ---- */
.page-body {
    padding: 2rem;
    flex: 1;
}

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

.card-header-custom {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body-custom { padding: 1.5rem; }

/* ---- Stat cards ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: border-color .2s, box-shadow .2s;
}

.stat-card:hover {
    border-color: var(--primary-dim);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.purple  { background: rgba(124,92,252,.15); color: var(--primary); }
.stat-icon.teal    { background: rgba(0,229,201,.12); color: var(--accent); }
.stat-icon.green   { background: rgba(34,211,138,.12); color: var(--success); }
.stat-icon.orange  { background: rgba(255,185,56,.12); color: var(--warning); }
.stat-icon.red     { background: rgba(255,77,106,.12); color: var(--danger); }
.stat-icon.blue    { background: rgba(58,182,255,.12); color: var(--info); }

.stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ---- Form controls ---- */
.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-base) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none;
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* ---- Buttons ---- */
.btn-primary-custom {
    background: var(--primary);
    border: none;
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
    font-family: 'DM Sans', sans-serif;
}

.btn-primary-custom:hover {
    background: var(--primary-dim);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary-custom:active { transform: none; }

.btn-danger-custom {
    background: rgba(255,77,106,.12);
    border: 1px solid rgba(255,77,106,.3);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    font-weight: 500;
    font-size: 0.83rem;
    cursor: pointer;
    transition: background .15s;
}

.btn-danger-custom:hover { background: rgba(255,77,106,.22); }

.btn-outline-custom {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    font-size: 0.83rem;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.btn-outline-custom:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Tables ---- */
.table-custom { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

.table-custom th {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.table-custom td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-base);
    vertical-align: middle;
}

.table-custom tr:last-child td { border-bottom: none; }
.table-custom tr:hover td { background: rgba(255,255,255,.02); }

/* ---- Badges ---- */
.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
}

.badge-success { background: rgba(34,211,138,.12); color: var(--success); border: 1px solid rgba(34,211,138,.25); }
.badge-danger  { background: rgba(255,77,106,.12);  color: var(--danger);  border: 1px solid rgba(255,77,106,.25); }
.badge-warning { background: rgba(255,185,56,.12);  color: var(--warning); border: 1px solid rgba(255,185,56,.25); }
.badge-info    { background: rgba(58,182,255,.12);  color: var(--info);    border: 1px solid rgba(58,182,255,.25); }
.badge-primary { background: var(--primary-glow);   color: var(--primary); border: 1px solid rgba(124,92,252,.35); }
.badge-muted   { background: rgba(136,136,170,.1);  color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Alerts ---- */
.alert-custom {
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.alert-success { background: rgba(34,211,138,.1);  border: 1px solid rgba(34,211,138,.25); color: var(--success); }
.alert-danger  { background: rgba(255,77,106,.1);   border: 1px solid rgba(255,77,106,.25); color: var(--danger); }
.alert-warning { background: rgba(255,185,56,.1);   border: 1px solid rgba(255,185,56,.25); color: var(--warning); }
.alert-info    { background: rgba(58,182,255,.1);   border: 1px solid rgba(58,182,255,.25); color: var(--info); }

/* ---- Code / token ---- */
.token-display {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--accent);
    word-break: break-all;
    letter-spacing: 0.3px;
}

/* ---- Progress bar ---- */
.progress-custom {
    background: var(--bg-input);
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-custom {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 20px;
    transition: width .4s ease;
}

/* ---- Pagination ---- */
.pagination-custom {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.page-btn {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-card2);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    transition: border-color .15s, color .15s;
}

.page-btn:hover, .page-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Mobile sidebar toggle ---- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-base);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ---- Profile info card ---- */
.ig-profile-card {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ig-profile-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.ig-profile-avatar-placeholder {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 2px solid var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
}

/* ---- Misc ---- */
.text-primary-custom { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted-custom { color: var(--text-muted); }
.text-success-custom { color: var(--success); }
.text-danger-custom { color: var(--danger); }
.text-warning-custom { color: var(--warning); }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .page-body { padding: 1rem; }
    .topbar { padding: 0 1rem; }
    .stat-value { font-size: 1.4rem; }
}

/* ---- Overlay for mobile ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }
