/* ===== VARIABLES ===== */
:root {
    --bg-deep: #0a0a0a;
    --bg-surface: #141414;
    --bg-card: #1a1a1a;
    --bg-elevated: #222;
    --border-subtle: rgba(255,255,255,0.06);
    --border-hover: rgba(200,255,0,0.3);
    --accent: #c8ff00;
    --accent-dim: rgba(200,255,0,0.15);
    --accent-glow: rgba(200,255,0,0.4);
    --hot: #ef4444;
    --hot-dim: rgba(239,68,68,0.15);
    --ink: #e8e8e8;
    --ink-muted: #888;
    --ink-faint: #8a8a8a;
    --upvote: #00e676;
    --downvote: #ef4444;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    background: var(--bg-deep);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #e0ff66; }

/* ===== NAVBAR ===== */
.gi-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10,10,10,0.8);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
}

.gi-nav .navbar-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--ink) !important;
    letter-spacing: -0.03em;
}

.gi-nav .navbar-brand span { color: var(--accent); }

.gi-nav .nav-link {
    color: var(--ink-muted) !important;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.gi-nav .nav-link:hover {
    color: var(--ink) !important;
    background: rgba(255,255,255,0.05);
}

.gi-nav .nav-link.nav-accent { color: var(--accent) !important; font-weight: 600; }
.gi-nav .nav-link.nav-accent:hover { background: var(--accent-dim); }

.gi-nav .navbar-toggler {
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 0.7rem;
    min-width: 44px;
    min-height: 44px;
}

.gi-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28200,255,0,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Desktop mega-menu dropdown */
@media (min-width: 992px) {
    .gi-nav .dropdown-menu.gi-mega-menu {
        background: rgba(16,16,16,0.97);
        backdrop-filter: blur(24px) saturate(1.4);
        -webkit-backdrop-filter: blur(24px) saturate(1.4);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius);
        box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(200,255,0,0.04);
        margin-top: 0.5rem;
        padding: 1rem 1.25rem;
        min-width: 480px;
        right: 0;
        left: auto;
    }

    .gi-mega-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }

    .gi-nav .dropdown-item {
        color: var(--ink-muted);
        font-size: 0.84rem;
        font-weight: 500;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        transition: all 0.15s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gi-nav .dropdown-item:hover,
    .gi-nav .dropdown-item:focus {
        background: var(--accent-dim);
        color: var(--accent);
    }

    .gi-nav .dropdown-toggle::after {
        font-size: 0.65em;
        vertical-align: 0.15em;
        margin-left: 0.35em;
        opacity: 0.5;
    }
}

/* Mobile dropdown */
@media (max-width: 991.98px) {
    .gi-nav .dropdown-menu.gi-mega-menu {
        position: static !important;
        float: none;
        border: none;
        box-shadow: none;
        background: rgba(255,255,255,0.03);
        margin: 0.25rem 0;
        border-radius: 8px;
        padding: 0.25rem 0;
        transform: none !important;
    }

    .gi-mega-grid {
        display: flex;
        flex-direction: column;
    }

    .gi-nav .dropdown-item {
        color: var(--ink-muted);
        padding: 0.5rem 1rem;
        font-size: 0.88rem;
        border-radius: 6px;
        transition: all 0.15s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .gi-nav .dropdown-item:hover,
    .gi-nav .dropdown-item:focus {
        background: var(--accent-dim);
        color: var(--accent);
    }
}

/* ===== MAIN CONTENT ===== */
main.gi-main {
    padding-top: 72px;
    min-height: calc(100vh - 200px);
}

/* ===== DISCLAIMER ===== */
.gi-disclaimer {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-top: 40px;
    font-size: 0.8rem;
    color: var(--ink-faint);
    line-height: 1.5;
}

/* ===== BREADCRUMBS ===== */
.breadcrumb { background: none; padding: 0; margin-bottom: 0.75rem; font-size: 0.82rem; }
.breadcrumb-item a { color: var(--ink-muted); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--ink-faint); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--ink-faint); }

/* ===== FOOTER ===== */
.gi-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 48px 0 32px;
    margin-top: 60px;
}

.gi-footer h5,
.gi-footer h6 {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gi-footer p { color: var(--ink-muted); font-size: 0.85rem; line-height: 1.6; }
.gi-footer ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1rem; }
.gi-footer li { margin-bottom: 6px; }
.gi-footer li a { color: var(--ink-muted); font-size: 0.85rem; transition: all 0.15s ease; }
.gi-footer li a:hover { color: var(--accent); padding-left: 4px; }

.gi-footer .footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
    margin-top: 32px;
}

.gi-footer .footer-bottom p,
.gi-footer .footer-bottom a { font-size: 0.8rem; color: var(--ink-faint); }
.gi-footer .footer-bottom a:hover { color: var(--accent); }

/* ===== BOOTSTRAP OVERRIDES ===== */
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; font-family: var(--font-body); }
.btn-primary:hover { background: #e0ff66; border-color: #e0ff66; color: #000; }

.btn-outline-secondary { border-color: var(--border-subtle); color: var(--ink-muted); }
.btn-outline-secondary:hover { background: rgba(255,255,255,0.05); border-color: var(--accent); color: var(--accent); }

.alert-warning { background: rgba(255,193,7,0.08); border-color: rgba(255,193,7,0.15); color: #ffc107; }

.modal-content { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.modal-header { border-bottom-color: var(--border-subtle); }
.modal-footer { border-top-color: var(--border-subtle); }

.spinner-border { color: var(--accent) !important; }

/* ===== SHARED: INSULT CARDS ===== */
.insult-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    height: 100%;
    transition: all 0.25s ease;
}

.insult-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px rgba(200,255,0,0.06);
    transform: translateY(-3px);
}

.insult-card .card-body { padding: 20px; }

.insult-card .card-text {
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

.category-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(200,255,0,0.15);
    text-decoration: none;
    white-space: nowrap;
    margin: 0 auto;
    transition: background 0.15s, color 0.15s;
}
a.category-badge:hover {
    background: var(--accent);
    color: var(--bg);
}

/* Card footer: votes left, actions right */
.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-utility {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ===== SHARED: VOTE BUTTONS ===== */
.vote-buttons { display: flex; gap: 4px; align-items: center; }

.vote-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    color: var(--ink-muted);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover:not(:disabled) { transform: scale(1.15); }
.vote-btn:disabled { cursor: not-allowed; opacity: 0.3; }
.vote-btn.active { opacity: 1; }

.vote-btn.upvote:hover:not(:disabled),
.vote-btn.upvote.active { background: rgba(0,230,118,0.15); color: var(--upvote); }

.vote-btn.downvote:hover:not(:disabled),
.vote-btn.downvote.active { background: rgba(239,68,68,0.15); color: var(--downvote); }

.vote-score {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 28px;
    text-align: center;
    color: var(--ink-muted);
    font-family: var(--font-body);
}

.vote-score.positive { color: var(--upvote); }
.vote-score.negative { color: var(--downvote); }

/* ===== SHARED: COPY BUTTON ===== */
.copy-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 4px;
    line-height: 1;
    color: var(--ink-muted);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover { background: var(--accent-dim); color: var(--accent); transform: scale(1.08); }
.copy-btn.copied { background: rgba(0,230,118,0.15); color: var(--upvote); }

/* ===== SHARED: SHARE BUTTON ===== */
.share-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 7px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    color: var(--ink-faint);
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover { background: rgba(29,161,242,0.15); color: #1da1f2; transform: scale(1.08); }

/* Utility buttons in card-utility are slightly smaller */
.card-utility .copy-btn {
    font-size: 0.9rem;
    padding: 7px 10px;
    min-height: 36px;
    min-width: 36px;
    margin-left: 0;
}

/* ===== SHARED: VOTE LOADING ===== */
.vote-btn.voting { pointer-events: none; opacity: 0.5; }
.vote-btn.voting i { display: none; }

.vote-btn.voting::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vote-spin 0.6s linear infinite;
    display: inline-block;
}

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

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

.insult-card.fade-in { animation: fadeInUp 0.4s ease both; }

/* ===== SHARED: MODAL ===== */
.modal-header.gi-modal-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header.gi-modal-header .modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
}

.modal-body .lead { color: var(--ink); font-size: 1.05rem; }
.modal-body .text-muted { color: var(--ink-muted) !important; }

.modal-footer .btn-secondary { background: var(--bg-elevated); border-color: var(--border-subtle); color: var(--ink); }
.modal-footer .btn-danger { background: var(--hot); border-color: var(--hot); }

.voted-modal-icon { font-size: 3rem; display: block; text-align: center; margin-bottom: 12px; }
.voted-modal-msg { text-align: center; color: var(--ink); font-size: 1.05rem; line-height: 1.5; margin: 0; }
.voted-modal-sub { text-align: center; color: var(--ink-faint); font-size: 0.85rem; margin-top: 8px; }

/* ===== SHARED: CENSORED WORDS ===== */
.censored-word {
    filter: blur(4px);
    transition: filter 0.2s ease;
    cursor: pointer;
    user-select: none;
    padding: 0 2px;
}

.censored-word:hover { filter: blur(0); }

/* ================================================================
   HOMEPAGE
   ================================================================ */

/* Hero */
.gi-hero { padding: 48px 0 32px; position: relative; }

.gi-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
    color: var(--ink);
}

.gi-hero h1 .accent { color: var(--accent); }

.gi-hero h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink-muted);
    margin-bottom: 16px;
}

.gi-hero .lead { color: var(--ink-muted); font-size: 0.95rem; max-width: 600px; }
.gi-hero .lead a { font-weight: 600; }

/* Insult of the Day */
.gi-iotd {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.gi-iotd::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
}

.gi-iotd .iotd-label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 10px;
}

.gi-iotd .iotd-text {
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Homepage Generator */
.hp-gen {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.hp-gen::before {
    content: '';
    position: absolute;
    top: -60%; left: -10%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(200,255,0,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hp-gen-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; position: relative; z-index: 1; }
.hp-gen-header h3 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--ink); }
.hp-gen-header h3 i { color: var(--accent); }

.hp-gen-header .hp-gen-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--accent);
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
}

.hp-gen-row { display: flex; gap: 12px; position: relative; z-index: 1; }

.hp-gen-input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.hp-gen-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,255,0,0.1); }
.hp-gen-input::placeholder { color: var(--ink-faint); }

.hp-gen-btn {
    background: var(--accent);
    border: none;
    color: #000;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: all 0.2s ease;
    min-height: 44px;
}

.hp-gen-btn:hover:not(:disabled) { background: #e0ff66; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,255,0,0.2); }
.hp-gen-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.hp-gen-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; position: relative; z-index: 1; }

.hp-gen-pill {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-body);
}

.hp-gen-pill:hover, .hp-gen-pill.active { background: var(--accent); color: #000; border-color: var(--accent); }

.hp-gen-results { margin-top: 16px; position: relative; z-index: 1; }
.hp-gen-results:empty { margin-top: 0; }

.hp-gen-result {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease both;
}

.hp-gen-result p { color: var(--ink); font-size: 1rem; line-height: 1.5; margin-bottom: 8px; }

.hp-gen-result-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hp-gen-result-actions .vote-group { display: flex; align-items: center; gap: 4px; }
.hp-gen-result-actions .util-group { display: flex; align-items: center; gap: 2px; }

.hp-gen-result .vote-btn { font-size: 0.85rem; padding: 4px 8px; min-height: 32px; min-width: 32px; }
.hp-gen-result .vote-score { font-size: 0.8rem; min-width: 20px; }

.hp-gen-result .hp-copy-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.15s ease;
    color: var(--ink-muted);
    font-family: var(--font-body);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.hp-gen-result .hp-copy-btn:hover { background: var(--accent-dim); color: var(--accent); }
.hp-gen-result .hp-copy-btn.copied { background: rgba(0,230,118,0.15); color: var(--upvote); }

.hp-gen-skeleton {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    height: 60px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.hp-gen-skeleton::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { left: 100%; } }

.hp-gen-error {
    background: var(--hot-dim);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--hot);
    font-size: 0.9rem;
}

.hp-gen-link { text-align: center; margin-top: 14px; position: relative; z-index: 1; }
.hp-gen-link a { font-size: 0.82rem; color: var(--ink-faint); font-weight: 500; }
.hp-gen-link a:hover { color: var(--accent); }

/* Trending AI Insults */
.hp-trending { margin-bottom: 36px; }

.hp-trending-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.hp-trending-header h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin: 0; }
.hp-trending-header i { color: var(--upvote); font-size: 0.85rem; }

.hp-trending-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.hp-trending-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem;
    color: var(--ink);
    vertical-align: middle;
}

.hp-trending-table tr:last-child td { border-bottom: none; }
.hp-trending-table tr { background: var(--bg-card); transition: background 0.15s ease; }

.hp-trending-table tr:first-child td:first-child { border-radius: var(--radius) 0 0 0; }
.hp-trending-table tr:first-child td:last-child { border-radius: 0 var(--radius) 0 0; }
.hp-trending-table tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
.hp-trending-table tr:last-child td:last-child { border-radius: 0 0 var(--radius) 0; }

.hp-trending-table tr:hover { background: var(--bg-elevated); }

.hp-trending-table .td-vote { width: 110px; white-space: nowrap; }

.td-vote-group { display: inline-flex; align-items: center; gap: 4px; }

.trend-vote-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    color: var(--ink-muted);
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trend-vote-btn:hover:not(:disabled) { transform: scale(1.1); }
.trend-vote-btn:disabled { cursor: not-allowed; opacity: 0.35; }

.trend-vote-btn.upvote:hover:not(:disabled),
.trend-vote-btn.upvote.active { background: rgba(0,230,118,0.15); color: var(--upvote); }

.trend-vote-btn.downvote:hover:not(:disabled),
.trend-vote-btn.downvote.active { background: rgba(239,68,68,0.15); color: var(--downvote); }

.trend-score { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; min-width: 22px; text-align: center; color: var(--ink-muted); }
.trend-score.positive { color: var(--upvote); }
.trend-score.negative { color: var(--downvote); }

.hp-trending-table .td-topic { width: 100px; font-size: 0.75rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.hp-trending-table .td-time { width: 80px; font-size: 0.75rem; color: var(--ink-faint); text-align: right; white-space: nowrap; }

/* Load More */
.gi-load-more { margin: 40px 0; }

.gi-load-more .btn {
    background: var(--accent);
    border: none;
    color: #000;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1rem;
    padding: 14px 40px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.gi-load-more .btn:hover { background: #e0ff66; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,255,0,0.2); }

/* Random Insult FAB */
.gi-fab {
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    right: 28px;
    z-index: 1000;
    background: var(--hot);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 6px 24px rgba(239,68,68,0.4);
    transition: all 0.25s ease;
    letter-spacing: -0.01em;
}

.gi-fab:hover { transform: scale(1.06) translateY(-2px); box-shadow: 0 10px 36px rgba(239,68,68,0.5); background: #f87171; color: #fff; }

/* ================================================================
   CATEGORY PAGE
   ================================================================ */

.gi-cat-header {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.gi-cat-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--hot));
}

.gi-cat-header::after {
    content: '';
    position: absolute;
    top: -80px; right: -60px;
    width: 250px; height: 250px;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
}

.gi-cat-header h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; color: var(--ink); margin-bottom: 6px; position: relative; z-index: 1; }

.gi-cat-header h2 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 400; color: var(--accent); margin-bottom: 12px; position: relative; z-index: 1; }

.gi-cat-header .lead { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 0; max-width: 700px; position: relative; z-index: 1; }

.gi-cat-desc { color: var(--ink-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 28px; padding: 0 4px; }

/* Related Categories */
.gi-related { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border-subtle); }
.gi-related h3 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); margin-bottom: 14px; }

.gi-related .cat-link {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: 8px;
}

.gi-related .cat-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.gi-related .cat-link.cat-link-accent { border-color: rgba(239,68,68,0.3); color: var(--hot); }
.gi-related .cat-link.cat-link-accent:hover { background: var(--hot-dim); border-color: var(--hot); }

/* ================================================================
   GENERATOR PAGE
   ================================================================ */

.gen-container { max-width: 860px; margin: 0 auto; padding: 20px 0 40px; }

.gen-header { text-align: center; padding: 36px 0 32px; }

.gen-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--accent), #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gen-header h2 { font-family: var(--font-body); font-size: 0.88rem; font-weight: 400; color: var(--ink-faint); margin-bottom: 10px; }
.gen-header p { font-size: 0.95rem; color: var(--ink-muted); max-width: 520px; margin: 0 auto; }

.gen-controls { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 28px; }

.topic-input { font-size: 1rem; padding: 14px 18px; border-radius: var(--radius); border: 2px solid rgba(255,255,255,0.08); background: var(--bg-elevated); color: var(--ink); transition: all 0.2s ease; font-family: var(--font-body); }
.topic-input::placeholder { color: var(--ink-faint); }
.topic-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); background: var(--bg-surface); color: var(--ink); outline: none; }

.tone-select { font-size: 1rem; padding: 14px 18px; border-radius: var(--radius); border: 2px solid rgba(255,255,255,0.08); background: var(--bg-elevated); color: var(--ink); font-family: var(--font-body); cursor: pointer; transition: all 0.2s ease; }
.tone-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); outline: none; }
.tone-select option { background: var(--bg-card); color: var(--ink); }

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.category-pill {
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-body);
}

.category-pill:hover, .category-pill.active { background: var(--accent); color: #000; border-color: var(--accent); transform: translateY(-1px); }

.cat-hidden { display: none; }
.cat-toggle { border-style: dashed; color: var(--ink-faint); }
.cat-toggle:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.generate-btn {
    font-size: 1rem;
    padding: 14px 36px;
    border-radius: var(--radius);
    font-weight: 700;
    font-family: var(--font-display);
    background: var(--accent);
    border: none;
    color: #000;
    transition: all 0.25s ease;
    letter-spacing: -0.01em;
}

.generate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(200,255,0,0.25); background: #e0ff66; color: #000; }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; color: #000; }

.results-area { min-height: 80px; }

.insult-result {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    animation: slideUp 0.35s ease both;
    transition: all 0.2s ease;
}

.insult-result:hover { border-color: var(--border-hover); box-shadow: 0 0 24px rgba(200,255,0,0.05); }

.insult-result:nth-child(1) { animation-delay: 0.03s; }
.insult-result:nth-child(2) { animation-delay: 0.08s; }
.insult-result:nth-child(3) { animation-delay: 0.13s; }
.insult-result:nth-child(4) { animation-delay: 0.18s; }
.insult-result:nth-child(5) { animation-delay: 0.23s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.insult-text { font-size: 0.98rem; line-height: 1.65; color: var(--ink); margin-bottom: 12px; }
.insult-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.insult-actions .vote-group { display: flex; align-items: center; gap: 4px; }
.insult-actions .util-group { display: flex; align-items: center; gap: 2px; }

/* Generator vote buttons (smaller) */
.insult-actions .vote-btn { font-size: 0.9rem; display: flex; gap: 4px; }
.insult-actions .vote-btn:hover:not(:disabled) { transform: scale(1.05); }
.insult-actions .vote-btn:disabled { opacity: 0.4; }
.insult-actions .vote-btn.upvote:hover:not(:disabled),
.insult-actions .vote-btn.upvote.active { background: rgba(0,230,118,0.12); }
.insult-actions .vote-btn.downvote:hover:not(:disabled),
.insult-actions .vote-btn.downvote.active { background: rgba(239,68,68,0.12); }
.insult-actions .vote-score { min-width: 24px; }

.copy-result-btn {
    border: none;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 7px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--ink-muted);
    font-family: var(--font-body);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.copy-result-btn:hover { background: var(--accent-dim); color: var(--accent); }
.copy-result-btn.copied { background: rgba(0,230,118,0.12); color: var(--upvote); }

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
    height: 80px;
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
}

.generation-count { text-align: center; margin-top: 20px; color: var(--ink-faint); font-size: 0.82rem; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-faint); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: 0.3; color: var(--accent); }
.empty-state p { font-size: 0.9rem; }

.form-label { color: var(--ink-muted); font-weight: 500; font-size: 0.85rem; }

/* ================================================================
   404 PAGE
   ================================================================ */

.gi-404 { text-align: center; padding: 80px 20px 60px; max-width: 600px; margin: 0 auto; }

.gi-404-code {
    font-family: var(--font-display);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--hot));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.gi-404 h2 { font-size: 1.3rem; color: var(--ink); margin-bottom: 24px; }

.gi-404-msg {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 32px;
    font-size: 1rem;
    color: var(--ink-muted);
    line-height: 1.6;
}

.gi-404 .sub { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 32px; }

.gi-404 .btn-home {
    background: var(--accent);
    color: #000;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 36px;
    border-radius: var(--radius);
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.gi-404 .btn-home:hover { background: #e0ff66; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,255,0,0.2); color: #000; }

.gi-404 .footer-snark { margin-top: 40px; color: var(--ink-faint); font-size: 0.78rem; }

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 991.98px) {
    .gi-nav .nav-link { padding: 0.75rem 1rem !important; min-height: 44px; }
}

@media (max-width: 767.98px) {
    body { font-size: 1.05rem; line-height: 1.5; letter-spacing: 0; }
    h1 { letter-spacing: -0.01em; }
    h2 { letter-spacing: -0.01em; }
    main.gi-main { padding-top: 68px; }
    .gi-disclaimer { padding: 12px 16px; font-size: 0.8rem; }
    .gi-footer { padding: 32px 0 20px; }
    .gi-footer p, .gi-footer a, .gi-footer li { font-size: 0.95rem; }
    .footer-bottom { flex-wrap: wrap; gap: 8px; justify-content: center !important; text-align: center; }

    /* Homepage mobile */
    .gi-hero h1 { font-size: 2rem; letter-spacing: -0.02em; }
    .gi-hero h2 { font-size: 1.05rem; letter-spacing: 0; }
    .gi-hero .lead { font-size: 1rem; }
    .gi-hero { padding: 52px 16px 28px; }
    .gi-fab { padding: 12px 22px; font-size: 0.88rem; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: 16px; }
    .gi-iotd { padding: 18px 16px; }
    .iotd-text { font-size: 1.05rem; }
    .gi-card { padding: 16px; }
    .gi-card .insult-text { font-size: 1.05rem; line-height: 1.5; }
    .gi-load-more .btn { width: 100%; font-size: 1rem; }
    .gi-card .cat-badge { font-size: 0.78rem; padding: 3px 10px; }
    .hp-gen { padding: 20px 16px; }
    .hp-gen-row { flex-direction: column; gap: 10px; }
    .hp-gen-btn { width: 100%; }
    .hp-gen-header h3 { font-size: 1rem; }

    /* Trending mobile */
    .hp-trending-table .td-topic { display: none; }
    .hp-trending-table .td-time { display: none; }
    .hp-trending-table td { padding: 10px 14px; font-size: 0.92rem; }

    /* Category page mobile */
    .gi-cat-header { padding: 20px 16px; }
    .gi-cat-header h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
    .gi-cat-header p { font-size: 0.95rem; }
    .insult-card { padding: 16px; }
    .insult-card .card-text { font-size: 1.05rem; line-height: 1.5; }
    .gi-related { margin-top: 28px; }
    .gi-related .cat-link { font-size: 0.88rem; }

    /* Generator page mobile */
    .gen-header h1 { font-size: 1.8rem; letter-spacing: -0.02em; }
    .gen-header { padding: 24px 16px 18px; }
    .gen-header p { font-size: 0.95rem; }
    .gen-controls { padding: 16px; }
    .insult-result { padding: 16px; }
    .insult-result .insult-text { font-size: 1rem; line-height: 1.5; }
    .generate-btn { width: 100%; padding: 14px 20px; font-size: 1rem; }
    .category-pills { gap: 6px; }
    .category-pill { font-size: 0.88rem; }
    .form-label { font-size: 0.9rem; }

    /* 404 page mobile */
    .gi-404 { padding: 48px 16px 40px; }
    .gi-404 h2 { font-size: 1.1rem; }
    .gi-404-msg { padding: 16px 18px; font-size: 0.92rem; }
    .gi-404 .btn-home { width: 100%; padding: 14px 24px; }
}
