/* ==========================================================================
   Spider On The Web — Shared Stylesheet
   Base theme, navigation, footer, cards, and common components.

   Usage: <link rel="stylesheet" href="shared.css">
   Place BEFORE page-specific <style> blocks so pages can override.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #e8e8e8;
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    padding: 40px 20px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   2. CONTAINER
   Pages can override max-width (800, 900, 1000, 1100) in their own styles.
   -------------------------------------------------------------------------- */
.container {
    max-width: 900px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   3. HEADER
   -------------------------------------------------------------------------- */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #222;
}

.logo {
    font-size: 40px;
    margin-bottom: 10px;
}

h1 {
    font-size: 28px;
    font-weight: 400;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.subtitle,
.tagline {
    color: #666;
    font-size: 14px;
}

.tagline {
    color: #a0a0a0;
    max-width: 500px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   4. TOP NAVIGATION BAR
   -------------------------------------------------------------------------- */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #222;
    border-radius: 10px;
    margin-bottom: 30px;
}

.top-nav a {
    color: #4a9c3f;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.3s;
}

.top-nav a:hover {
    color: #7dcc70;
}

@media (max-width: 600px) {
    .top-nav a {
        display: block;
        margin: 10px 0;
    }
}

/* --------------------------------------------------------------------------
   5. BOTTOM NAVIGATION LINKS
   -------------------------------------------------------------------------- */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
    flex-wrap: wrap;
}

.nav-links a {
    color: #4a9c3f;
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #7dcc70;
}

/* --------------------------------------------------------------------------
   6. BACK LINK (used on category hub pages)
   -------------------------------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 40px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #4a9c3f;
}

/* --------------------------------------------------------------------------
   7. FOOTER
   -------------------------------------------------------------------------- */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
    color: #444;
    font-size: 12px;
}

footer p {
    color: #a0a0a0;
    font-size: 12px;
    margin-bottom: 8px;
}

footer a {
    color: #a0a0a0;
    text-decoration: none;
}

footer a:hover {
    color: #d0d0d0;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    display: inline-block;
    padding: 8px 16px;
    background: #111;
    border: 1px solid #222;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
}

.social-links a:hover {
    border-color: #333;
    background: #1a1a1a;
}

/* Footer variant used on hub pages (tools.html, cheatsheets.html, ai.html) */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #4a9c3f;
}

.copyright {
    color: #333;
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   8. CARD GRID (index page, hub pages)
   -------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   9. CARDS
   -------------------------------------------------------------------------- */
.card {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card:hover {
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card .icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .content {
    flex: 1;
    min-width: 0;
}

.card h3 {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card p {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card color variants */
.card.tool {
    border-left: 3px solid #4a9c3f;
}

.card.tool:hover {
    border-color: #4a9c3f;
    border-left-color: #4a9c3f;
}

.card.cheatsheet {
    border-left: 3px solid #70aacc;
}

.card.cheatsheet:hover {
    border-color: #70aacc;
    border-left-color: #70aacc;
}

.card.ai {
    border-left: 3px solid #a78bfa;
}

.card.ai:hover {
    border-color: #a78bfa;
    border-left-color: #a78bfa;
}

.card.api {
    border-left: 3px solid #e6c07b;
}

.card.api:hover {
    border-color: #e6c07b;
    border-left-color: #e6c07b;
}

/* --------------------------------------------------------------------------
   10. BADGES & TAGS
   -------------------------------------------------------------------------- */
.new-badge {
    background: #2d5a27;
    color: #7dcc70;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popular-tag {
    display: inline-block;
    background: #2d5a27;
    color: #4a9c3f;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.new-tag {
    display: inline-block;
    background: #1a2d1a;
    color: #7dcc70;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   11. SECTION LABELS
   -------------------------------------------------------------------------- */
.section-label {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 15px 0;
    padding-left: 5px;
}

.section-label:first-child {
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   12. COPY BUTTON (used on all generator/tool pages)
   -------------------------------------------------------------------------- */
.copy-btn {
    background: #1a2d1a;
    border: 1px solid #2d5a27;
    border-radius: 6px;
    padding: 8px 16px;
    color: #7dcc70;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #2d5a27;
    color: #fff;
}

.copy-btn.copied {
    background: #4a9c3f;
    color: #fff;
}

/* --------------------------------------------------------------------------
   13. CODE BLOCKS (used on cheatsheets and generators)
   -------------------------------------------------------------------------- */
.code-block {
    background: #0d0d0d;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
}

code {
    color: #7dcc70;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.comment {
    color: #555;
}

/* --------------------------------------------------------------------------
   14. CODE OUTPUT PANEL (used on generator pages)
   -------------------------------------------------------------------------- */
.code-output {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.code-header h3 {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   15. CONTROLS PANEL (used on generator pages)
   -------------------------------------------------------------------------- */
.controls {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 150px;
}

.control-group label {
    display: block;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   16. FORM ELEMENTS
   -------------------------------------------------------------------------- */
select {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #4a9c3f;
}

textarea,
input[type="text"] {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #a78bfa;
}

/* --------------------------------------------------------------------------
   17. RELATED PAGES SECTION (inline-styled on pages; class-based version)
   Use .related-section as a drop-in replacement for the inline-styled divs.
   -------------------------------------------------------------------------- */
.related-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #222;
}

.related-section .related-label {
    color: #888;
    font-size: 12px;
    margin-bottom: 10px;
}

.related-section .related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.related-section .related-links a {
    color: #6ee7b7;
    text-decoration: none;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

.related-section .related-links a:hover {
    border-bottom-color: #6ee7b7;
}

/* --------------------------------------------------------------------------
   18. TIP BOXES (used on cheatsheet pages)
   -------------------------------------------------------------------------- */
.tip {
    background: #1a2d1a;
    border: 1px solid #2d5a27;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    font-size: 13px;
    color: #7dcc70;
}

.tip-label {
    font-weight: 600;
    margin-bottom: 5px;
}

/* --------------------------------------------------------------------------
   19. PROPERTY CARDS (used on cheatsheet pages)
   -------------------------------------------------------------------------- */
.property {
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.property-name {
    color: #70aacc;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.property-desc {
    color: #888;
    font-size: 13px;
    margin-bottom: 15px;
}

/* --------------------------------------------------------------------------
   20. HEADINGS (h2 — used on cheatsheet pages)
   -------------------------------------------------------------------------- */
h2 {
    color: #4a9c3f;
    font-size: 18px;
    font-weight: 500;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a1a1a;
}

/* --------------------------------------------------------------------------
   21. PRINT STYLES (for cheat sheets)
   -------------------------------------------------------------------------- */
@media print {
    body {
        background: #fff !important;
        color: #111 !important;
        padding: 20px !important;
        font-size: 11px !important;
    }
    .container { max-width: 100% !important; }
    header { border-bottom-color: #ccc !important; }
    .logo { font-size: 24px !important; }
    h1 { color: #111 !important; font-size: 22px !important; }
    h2 { color: #222 !important; border-bottom-color: #ccc !important; }
    .subtitle, .tagline { color: #666 !important; }
    .top-nav, .nav-links, .back-link, footer,
    .related-section, .social-links { display: none !important; }
    .property, .card, .controls, .code-output, .code-block, .tip {
        background: #f5f5f5 !important;
        border-color: #ccc !important;
        color: #111 !important;
        break-inside: avoid;
    }
    .property-name { color: #0066cc !important; }
    .property-desc { color: #333 !important; }
    code { color: #006600 !important; }
    .comment { color: #999 !important; }
    .tip { background: #f0fff0 !important; border-color: #090 !important; color: #333 !important; }
    a { color: #0066cc !important; }
    .card h3, .card p { color: #111 !important; }
    .new-badge, .popular-tag, .new-tag { display: none !important; }
}
