/* ========================================
   SQLI BLOG - Stunning Dark Hacker Theme
   ======================================== */

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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --accent: #00ff41;
    --accent-dim: #00cc33;
    --accent-glow: rgba(0, 255, 65, 0.15);
    --accent-glow-strong: rgba(0, 255, 65, 0.3);
    --text-primary: #e0e0e8;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --border: #2a2a3a;
    --danger: #ff3366;
    --purple: #a855f7;
    --blue: #3b82f6;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Glow orbs floating in background */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: orbFloat 15s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-100px, 100px); }
    66% { transform: translate(50px, -50px); }
}

/* ===== HEADER ===== */
.header {
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: text-shadow 0.3s;
}

.logo:hover {
    text-shadow: 0 0 20px var(--accent-glow-strong), 0 0 40px var(--accent-glow);
}

.logo-icon {
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(0, 255, 65, 0.1) 50%, transparent 60%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translate(-100%, -100%); }
    100% { transform: translate(100%, 100%); }
}

.header-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* ===== PAGE TITLE ===== */
.page-title {
    text-align: center;
    margin-bottom: 50px;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #40ffb5, var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
    margin-bottom: 10px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.page-title p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ===== ARTICLES GRID ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

/* ===== ARTICLE CARD ===== */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple), var(--blue));
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
    transform: translateY(-4px);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px var(--accent-glow);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card-number {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
}

.article-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.4;
    transition: color 0.3s;
}

.article-card:hover h2 {
    color: var(--accent);
}

.article-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.read-more {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s;
}

.article-card:hover .read-more {
    gap: 12px;
}

.read-more-arrow {
    transition: transform 0.3s;
}

.article-card:hover .read-more-arrow {
    transform: translateX(4px);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.pagination button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.pagination button.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow-strong);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== LOADING SPINNER ===== */
.loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* ===== ARTICLE DETAIL PAGE ===== */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 30px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.25s;
}

.back-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.article-detail-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.article-detail-id {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.article-detail-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.article-detail-body {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.article-detail-body p {
    margin-bottom: 1.5em;
}

/* ===== ERROR STATE ===== */
.error-box {
    text-align: center;
    padding: 60px 30px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 16px;
    max-width: 500px;
    margin: 60px auto;
}

.error-box h2 {
    color: var(--danger);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.error-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.error-box a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: box-shadow 0.3s;
}

.error-box a:hover {
    box-shadow: 0 0 20px var(--accent-glow-strong);
}

/* ===== SQL DUMP (visible when injection succeeds) ===== */
.sql-dump {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #c9d1d9;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 30px;
    margin-top: 60px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.footer span {
    color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .page-title h1 {
        font-size: 1.8rem;
    }

    .article-detail-header h1 {
        font-size: 1.6rem;
    }

    .header-inner {
        padding: 16px 20px;
    }

    .container {
        padding: 24px 20px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== SELECTION ===== */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ===== FADE IN ANIMATION ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
