/**
 * Yıldız İzleri Admin Panel - Özel CSS
 * Kozmik karanlık tema - Bootstrap 5 üzerine inşa edilmiştir.
 */

/* ─── Değişkenler ─────────────────────────────────────────────── */
:root {
    --bg-main:          #0a0a1a;
    --bg-sidebar:       #0f0f2d;
    --bg-card:          #12122a;
    --bg-card-hover:    #161636;
    --bg-input:         #1a1a35;
    --bg-table-row:     #0e0e24;
    --bg-table-hover:   #14143a;

    --accent:           #8B5CF6;
    --accent-hover:     #7C3AED;
    --accent-light:     rgba(139, 92, 246, 0.15);
    --accent-glow:      rgba(139, 92, 246, 0.4);

    --text-primary:     #e8e8f0;
    --text-secondary:   #9090b0;
    --text-muted:       #606080;

    --border-color:     rgba(139, 92, 246, 0.2);
    --border-subtle:    rgba(255, 255, 255, 0.07);

    --sidebar-width:    260px;
    --topbar-height:    65px;

    --success:          #10b981;
    --danger:           #ef4444;
    --warning:          #f59e0b;
    --info:             #3b82f6;

    --font-heading:     'Noto Serif', Georgia, serif;
    --font-body:        'Inter', system-ui, sans-serif;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ─── Yıldız Arkaplanı (subtle) ──────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.12) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 60%, rgba(255,255,255,0.10) 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 70%, rgba(255,255,255,0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.10) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-light) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--accent-light);
    border-radius: 2px;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-light);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #6D28D9);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.sidebar-nav .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-user-avatar {
    font-size: 1.8rem;
    color: var(--accent);
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-logout {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.8rem;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    display: block;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─── Ana İçerik ──────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* ─── Topbar ──────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: rgba(15, 15, 45, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
    padding: 0;
}

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

/* ─── İçerik Alanı ──────────────────────────────────────────── */
.content-area {
    flex: 1;
    padding: 28px;
}

.content-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(15, 15, 45, 0.5);
}

/* ─── Kartlar ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.card-header {
    background: rgba(139, 92, 246, 0.08);
    border-bottom: 1px solid var(--border-color);
    border-radius: 14px 14px 0 0 !important;
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* İstatistik Kartları */
.stat-card {
    text-align: center;
    padding: 28px 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.08;
}

.stat-card.users::before    { background: var(--info); }
.stat-card.dreams::before   { background: #6366f1; }
.stat-card.horoscopes::before{ background: var(--accent); }
.stat-card.api::before      { background: var(--success); }

.stat-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 6px currentColor);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 6px;
}

/* ─── Tablolar ──────────────────────────────────────────────── */
.table {
    color: var(--text-primary);
    margin: 0;
}

.table thead th {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody tr {
    border-color: var(--border-subtle);
    transition: background 0.15s;
}

.table tbody tr:hover {
    background: var(--bg-table-hover) !important;
}

.table tbody td {
    border-color: var(--border-subtle);
    padding: 12px 16px;
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(139, 92, 246, 0.03);
    color: var(--text-primary);
}

/* ─── Formlar ───────────────────────────────────────────────── */
.form-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

.form-control:disabled,
.form-control[readonly] {
    background: rgba(26, 26, 53, 0.5);
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ─── Butonlar ──────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6D28D9);
    border: none;
    color: #fff;
    font-weight: 500;
    border-radius: 8px;
    padding: 9px 20px;
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-outline-danger {
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    background: transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.6);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 5px 12px;
}

/* ─── Rozetler / Badge ──────────────────────────────────────── */
.badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 20px;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.bg-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.bg-primary {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge.bg-secondary {
    background: rgba(148, 163, 184, 0.1) !important;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ─── Alertler ─────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

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

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.btn-close {
    filter: invert(1) opacity(0.6);
}

/* ─── Modaller ─────────────────────────────────────────────── */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px 24px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 16px 24px;
}

.modal-backdrop.show {
    opacity: 0.7;
}

/* ─── Giriş Sayfası ────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(109, 40, 217, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(139, 92, 246, 0.1);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    font-size: 3.5rem;
    display: block;
    filter: drop-shadow(0 0 15px var(--accent-glow));
    animation: pulse-glow 3s ease-in-out infinite;
}

.login-logo-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
}

.login-logo-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)); }
}

/* ─── Status Göstergeleri ──────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.green {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.red {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.status-dot.yellow {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ─── Yükleme Animasyonu ───────────────────────────────────── */
.spinner-cosmic {
    width: 36px;
    height: 36px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ─── Masked Secret Input ──────────────────────────────────── */
.secret-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.secret-field .form-control {
    font-family: monospace;
    letter-spacing: 0.05em;
}

/* ─── Sayfalama ────────────────────────────────────────────── */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pagination .page-link:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ─── Arama Alanı ──────────────────────────────────────────── */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 38px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ─── Boş Durum ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* ─── Burç İkonları ────────────────────────────────────────── */
.zodiac-icon {
    font-size: 1.2rem;
    margin-right: 4px;
}

/* ─── Prompt İçerik Önizleme ───────────────────────────────── */
.prompt-preview {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .login-card {
        padding: 28px 20px;
    }

    .topbar {
        padding: 0 16px;
    }
}

/* ─── Yardımcı Sınıflar ────────────────────────────────────── */
.text-accent   { color: var(--accent); }
.text-violet   { color: #a78bfa; }
.bg-card       { background: var(--bg-card); }
.border-accent { border-color: var(--border-color) !important; }
.font-mono     { font-family: monospace; }

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

/* Section başlıkları */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
    margin-left: 8px;
}

/* Install sayfası */
.install-card {
    max-width: 600px;
    margin: 40px auto;
}

/* Code blokları */
code {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: monospace;
}

pre {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    color: var(--text-primary);
    font-size: 0.85rem;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}
