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

body {
    background-color: #000;
    color: #00ff00;
    font-family: Consolas, Monaco, monospace;
    margin: 0;
    padding: 20px;
}

img,
iframe {
    max-width: 100%;
    height: auto;
}

/* Red outline button for page-specific disclaimers */
.home-btn.page-disclaimer {
    background-color: #8b0000;
    color: #fff;
    border-color: #ff4444;
}

.home-btn.page-disclaimer:hover {
    background-color: #ff4444;
    color: #000;
}

/* Make regular content links easier to read (keep navbar/buttons styled separately) */
a {
    color: #ffd700;
    text-decoration: none;
}

a:hover {
    color: #fff176;
    text-decoration: underline;
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    border-bottom: 2px solid #00ff00;
}

.home-btn {
    color: #00ff00;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 15px;
    border: 1px solid #00ff00;
    background-color: #000;
    transition: all 0.2s ease;
}

.home-btn:hover {
    background-color: #00ff00;
    color: #000;
    cursor: pointer;
}

.navbar a + a {
    margin-left: 12px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

.button-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0 0;
    padding: 12px 24px;
    background-color: #00ff00;
    color: #000;
    text-decoration: none;
    border: 2px solid #00ff00;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    min-width: 140px;
}

.button:hover {
    background-color: transparent;
    color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: scale(1.05);
}

h1 {
    text-align: center;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #7fff7f;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #00ff00;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #111;
}

tr:hover {
    background-color: #0a0a0a;
}

.card {
    border: 2px solid #00ff00;
    padding: 20px;
    margin-top: 20px;
    background-color: #0a0a0a;
}

.card h2 {
    margin-top: 0;
    color: #00ff00;
}

.disclaimer-card {
    border: 2px solid #ff0000;
    background-color: #100000;
    padding: 24px;
    margin: 20px auto;
    max-width: 760px;
    text-align: center;
}

.button-bar {
    text-align: center;
}

.button {
    display: inline-block;
    margin: 15px 6px 0;
    padding: 12px 24px;
    background-color: #00ff00;
    color: #000;
    text-decoration: none;
    border: 2px solid #00ff00;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.button:hover {
    background-color: transparent;
    color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: scale(1.05);
}

.footer-disclaimer {
    border: 2px solid #ff0000;
    background-color: #100000;
    padding: 14px 20px;
    margin: 24px auto 0;
    max-width: 760px;
    text-align: center;
}

.footer-link {
    margin: 0;
}

.footer-link a {
    color: #ff0000;
    text-decoration: underline;
    font-weight: bold;
}

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

iframe {
    width: 100vw;
    height: 100vh;
    border: none;
}
/* Listing pages */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.listing-card {
    border: 2px solid #00ff00;
    background-color: #0a0a0a;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.listing-card h3 {
    margin-top: 0;
    color: #00ff00;
    font-size: 20px;
}

.listing-card p {
    color: #00ff00;
    margin: 10px 0;
    line-height: 1.6;
}

.community-link {
    display: inline-block;
    background-color: #5865F2;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.2s ease;
    margin-top: 15px;
}

.community-link:hover {
    background-color: #4752C4;
    transform: scale(1.05);
}

.community-link:visited {
    color: #fff;
}

/* SQL sandbox page */
.sql-page {
    background: #111;
    color: #eee;
    font-family: monospace;
}

.sql-page button {
    padding: 10px 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

.sql-page textarea {
    width: 100%;
    height: 600px;
    background: #1a1a1a;
    color: #00ff88;
    border: 1px solid #444;
    padding: 12px;
    resize: vertical;
    font-family: monospace;
    font-size: 14px;
    white-space: pre;
}

/* Default code library page */
.page-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
    padding-bottom: 100px;
}

aside {
    position: sticky;
    top: 20px;
    align-self: start;
    background: #070707;
    border: 1px solid #00ff00;
    padding: 16px;
    max-height: calc(100vh - 80px);
    overflow: auto;
}

.sidebar-title {
    margin-top: 0;
    margin-bottom: 14px;
    color: #7fff7f;
    font-size: 18px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    display: block;
    color: #00ff00;
    text-decoration: none;
    padding: 8px 10px;
    border: 1px solid #00ff00;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
    background: #00ff00;
    color: #000;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.code-section {
    border: 1px solid #00ff00;
    padding: 16px;
    background: #0a0a0a;
}

.code-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #7fff7f;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-header h2 {
    margin: 0;
}

.copy-btn {
    background: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #00ff00;
    color: #000;
}

.code-block {
    width: 100%;
    box-sizing: border-box;
    min-height: 180px;
    max-width: 100%;
    background: #111;
    color: #00ff88;
    border: 1px solid #444;
    padding: 12px;
    resize: none;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    white-space: pre-wrap;
}

.scroll-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.scroll-buttons button {
    background: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.scroll-buttons button:hover {
    background: #00ff00;
    color: #000;
}

@media (max-width: 980px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    aside {
        position: static;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .navbar {
        justify-content: center;
    }

    .home-btn,
    .button {
        flex: 1 1 100%;
        min-width: auto;
        white-space: normal;
    }

    .listing-card {
        min-height: auto;
    }

    .code-block {
        font-size: 13px;
    }

    .sql-page textarea {
        min-height: 45vh;
    }
}
