/* ============================================
   BingAutoIndexer - Professional Light Blue Theme
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #6366f1;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

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

/* ---- Navbar ---- */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand svg { width: 28px; height: 28px; }
.navbar-menu { display: flex; align-items: center; gap: 16px; }
.navbar-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    transition: all 0.2s;
}
.navbar-menu a:hover, .navbar-menu a.active {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-credits {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
}
.nav-user {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
}
.nav-user:hover { background: var(--light); }
.nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 8px;
    z-index: 200;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--dark);
    font-size: 14px;
}
.dropdown-menu a:hover { background: var(--light); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}
.page-header p { color: var(--gray); margin-top: 4px; }

/* ---- Cards ---- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--dark); }
.stat-label { font-size: 13px; color: var(--gray); margin-top: 2px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dark);
}
.btn-outline:hover { background: var(--light); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea.form-control { min-height: 150px; resize: vertical; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    background: var(--light);
    border-bottom: 1px solid var(--border);
}
table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
table tr:hover { background: #f8fafc; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #f3e8ff; color: #6b21a8; }

/* ---- Progress Bar ---- */
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-bar-success { background: var(--success); }
.progress-bar-primary { background: var(--primary); }

/* ---- URL Submission Box ---- */
.submit-box {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}
.submit-box h3 { font-size: 18px; color: var(--primary); margin-bottom: 8px; }
.submit-box p { color: var(--gray); margin-bottom: 16px; }

/* ---- Alert/Flash ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Auth Pages ---- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}
.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--primary);
}
.auth-card p.subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 24px;
}
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray);
}

/* ---- Pricing Cards ---- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.pricing-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}
.pricing-card:hover, .pricing-card.popular {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.pricing-card.popular { position: relative; }
.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 2px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.pricing-credits { font-size: 36px; font-weight: 800; color: var(--primary); }
.pricing-label { color: var(--gray); font-size: 14px; }
.pricing-price { font-size: 20px; font-weight: 700; margin: 12px 0; }
.pricing-price span { font-size: 14px; color: var(--gray); font-weight: 400; }

/* ---- Submission Result ---- */
.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.result-item:last-child { border-bottom: none; }
.result-site { font-size: 13px; color: var(--dark); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .navbar-menu { display: none; }
    .container { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; }
    .auth-card { margin: 16px; padding: 24px; }
    .mobile-menu-btn { display: block; }
}

/* ---- Loading Spinner ---- */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Live Status ---- */
.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.live-dot.green { background: var(--success); animation: pulse 1.5s infinite; }
.live-dot.red { background: var(--danger); }
.live-dot.yellow { background: var(--warning); animation: pulse 1.5s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- Sidebar for Admin ---- */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 16px;
    flex-shrink: 0;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--primary-light);
    color: var(--primary);
}
.admin-content { flex: 1; padding: 24px; }
