/* For Want Of Fuel specific styles */

/* Container layout */
.content-container.fuel-layout {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(700px, 900px) minmax(200px, 1fr);
    gap: var(--space-xl);
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-lg);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--ink);
}

/* Document header - base styling in shared.css */

/* Content positioning */
.for-want-of-fuel-content {
    grid-column: 2;
    width: 100%;
    max-width: 900px;
    line-height: var(--line-height-base);
}

/* Sidenotes positioning */
.sidenotes {
    grid-column: 3;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

/* Metadata and PDF download - base styling in shared.css */

/* Stat blocks */
.stat-block {
    background: var(--bg-raised);
    padding: var(--space-md);
    border-radius: var(--radius);
    margin: var(--space-md) 0;
}

.stat-block-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.stat-block-title {
    font-size: 1.2em;
    font-weight: bold;
}

.stat-block-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Tags — scoped to the fuel layout so it doesn't clobber the canonical chip. */
.fuel-layout .tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-dip);
    border-radius: var(--radius);
    font-size: 0.9em;
    margin: 0 0.2rem;
}

/* Tables - SWN Style */
.weapon-table,
.fitting-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    font-size: 0.9em;
    line-height: 1.5;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.weapon-table th,
.fitting-table th {
    background: var(--bg-raised);
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85em;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}

.weapon-table td,
.fitting-table td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.weapon-table tr:last-child td,
.fitting-table tr:last-child td {
    border-bottom: none;
}

.weapon-table tr:nth-child(even),
.fitting-table tr:nth-child(even) {
    background: var(--bg-raised);
}

.weapon-table tr:hover,
.fitting-table tr:hover {
    background: var(--bg-raised);
}

/* Weapon table specific styles */
.weapon-table td:nth-child(1) { /* Name */
    font-weight: 500;
    color: var(--accent);
}

.weapon-table td:nth-child(2), /* Range */
.weapon-table td:nth-child(3) { /* Damage */
    font-family: var(--font-mono);
    text-align: center;
    white-space: nowrap;
}

.weapon-table td:nth-child(4) { /* Type */
    text-align: center;
    font-weight: 500;
}

.weapon-table td:nth-child(5) { /* Tags */
    color: var(--ink-soft);
}

/* Fitting table specific styles */
.fitting-table td:nth-child(1) { /* Name */
    font-weight: 500;
    color: var(--accent);
}

.fitting-table td:nth-child(2) { /* Effect */
    color: var(--ink-soft);
}

.fitting-table td:nth-child(3), /* Power */
.fitting-table td:nth-child(4) { /* Mass */
    font-family: var(--font-mono);
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .weapon-table,
    .fitting-table {
        font-size: 0.85em;
    }

    .weapon-table td,
    .fitting-table td {
        padding: 0.75rem 0.5rem;
    }

    .weapon-table th,
    .fitting-table th {
        padding: 0.75rem 0.5rem;
    }
}

/* Rules parts */
.rules-part {
    margin: var(--space-lg) 0;
}

.rules-part h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--ink);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-sm);
}

/* Part title: printed by the layout from `title`, one step above the part's own h2s. */
.content-container.fuel-layout .rules-part-header h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin: 1.5rem 0 3rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Abstract - base styling in shared.css */

/* Responsive adjustments */
@media (max-width: 1200px) {
    .content-container.fuel-layout {
        grid-template-columns: minmax(200px, 250px) minmax(auto, 700px);
        gap: var(--space-lg);
    }

    .sidenotes {
        display: none;
    }
}

@media (max-width: 900px) {
    .content-container.fuel-layout {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }

    .for-want-of-fuel-content {
        grid-column: 1;
    }

    .toc {
        position: static;
        height: auto;
        margin-bottom: var(--space-lg);
        padding: var(--space-md);
        background: var(--bg-raised);
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }
}

/* Frame Table - Technical Spec Style */
.frame-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    font-size: 0.85em;
    line-height: 1.5;
    background: var(--bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.frame-table th {
    background: var(--bg-raised);
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.8em;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
    white-space: nowrap;
}

.frame-table td {
    padding: 0.875rem 0.5rem;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.frame-table tr:last-child td {
    border-bottom: none;
}

.frame-table tr:nth-child(even) {
    background: var(--bg-raised);
}

.frame-table tr:hover {
    background: var(--bg-raised);
}

/* Frame table specific column styles */
.frame-table td:first-child { /* Hull name */
    text-align: left;
    font-weight: 500;
    color: var(--accent);
    padding-left: 1rem;
}

.frame-table td:nth-child(2), /* Cost */
.frame-table td:nth-child(3) { /* Maintenance */
    font-family: var(--font-mono);
    letter-spacing: -0.05em;
}

/* Stats columns */
.frame-table td:nth-child(4), /* Speed */
.frame-table td:nth-child(5), /* Armor */
.frame-table td:nth-child(6), /* HP */
.frame-table td:nth-child(7), /* AC */
.frame-table td:nth-child(8), /* Power */
.frame-table td:nth-child(9), /* Mass */
.frame-table td:nth-child(10) { /* Hardpoints */
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Special indicators (* and #) */
.frame-table td sup {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.85em;
}

/* Class column */
.frame-table td:last-child {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .frame-table {
        font-size: 0.75em;
    }

    .frame-table th,
    .frame-table td {
        padding: 0.75rem 0.35rem;
    }

    .frame-table td:first-child {
        padding-left: 0.5rem;
    }
}

/* Mech Template - Card Style */
.mech-template {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    margin: 1.5rem 0;
    padding: 0;
    color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mech-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
    border-radius: 6px 6px 0 0;
}

.mech-name {
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
}

.frame-type {
    color: #888;
    font-size: 0.85em;
    text-transform: uppercase;
}

.mech-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: #1d1d1d;
}

.stat-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem;
    border-bottom: 1px solid #333;
}

.stat-label {
    color: #6a9ec7;
    font-size: 0.85em;
}

.stat-value {
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 500;
}

.mech-section {
    padding: 0.75rem 1rem;
    border-top: 1px solid #333;
}

.section-header {
    color: #6a9ec7;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.weapon-item, .fitting-item {
    background: #252525;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.item-name {
    color: #fff;
    margin-bottom: 0.2rem;
    font-size: 0.95em;
}

.item-stats {
    color: #888;
    font-size: 0.85em;
    line-height: 1.3;
}

/* Weapon specific styles */
.weapon-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.weapon-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.weapon-stat-label {
    color: #6a9ec7;
    font-size: 0.8em;
}

.weapon-stat-value {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.mech-tag {
    background: #333;
    color: #ccc;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.75em;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .mech-template-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mech-stats-grid {
        grid-template-columns: 1fr;
    }

    .weapon-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Weapon Category Tables */
.weapon-category {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    margin: 2rem 0;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.weapon-category h3 {
    color: #6a9ec7;
    font-size: 1.2em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}

.weapon-list {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #ccc;
}

.weapon-item-row {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) 80px 120px 80px 2fr 2fr 60px;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    align-items: center;
}

.weapon-header {
    color: #6a9ec7;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #444;
    font-weight: bold;
}

.weapon-name {
    color: #fff;
    font-weight: 500;
}

.weapon-range,
.weapon-damage,
.weapon-type {
    font-family: var(--font-mono);
    color: #aaa;
    text-align: center;
}

.weapon-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.weapon-tags .tag-highlight {
    font-size: 0.85em;
    margin: 0;
    background: rgba(106, 158, 199, 0.1);
}

.weapon-tags .tag-highlight:hover {
    transform: translateY(-1px);
}

/* Ensure popups appear above the table */
.tag-popup {
    z-index: 1000;
}

/* Compact view for mobile */
@media (max-width: 768px) {
    .weapon-item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .weapon-header {
        display: none;
    }

    .weapon-item-row > * {
        position: relative;
        padding-left: 100px;
    }

    .weapon-item-row > *::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 90px;
        color: #6a9ec7;
        font-size: 0.85em;
        text-transform: uppercase;
    }

    .weapon-name {
        padding-left: 0;
        font-size: 1.1em;
        margin-bottom: 0.5rem;
    }

    .weapon-tags {
        padding-left: 0;
        margin: 0.5rem 0;
    }
}

/* Fitting Category Tables */
.fitting-category {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    margin: 2rem 0;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.fitting-category h3 {
    color: #6a9ec7;
    font-size: 1.2em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}

.fitting-list {
    font-family: inherit;
    font-size: 0.9em;
    color: #ccc;
}

.fitting-item-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 3fr 80px;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    align-items: start;
}

.fitting-header {
    color: #6a9ec7;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #444;
    font-weight: bold;
}

.fitting-name {
    color: #fff;
    font-weight: 500;
}

.fitting-effect {
    color: #aaa;
    line-height: 1.4;
}

.fitting-sp {
    color: #6a9ec7;
    text-align: center;
    font-weight: 500;
    font-family: var(--font-mono);
}

/* Compact view for mobile */
@media (max-width: 768px) {
    .fitting-item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .fitting-header {
        display: none;
    }

    .fitting-item-row > * {
        position: relative;
        padding-left: 100px;
    }

    .fitting-item-row > *::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 90px;
        color: #6a9ec7;
        font-size: 0.85em;
        text-transform: uppercase;
    }

    .fitting-name {
        padding-left: 0;
        font-size: 1.1em;
        margin-bottom: 0.5rem;
    }

    .fitting-effect {
        padding-left: 0;
    }

    .fitting-sp {
        text-align: left;
    }
}

/* Frame Catalog */
.frame-note {
    background: #252525;
    border-left: 4px solid #6a9ec7;
    padding: 1rem;
    margin: 2rem 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: #aaa;
}

.frame-category {
    margin: 3rem 0;
}

.frame-category h3 {
    color: #6a9ec7;
    font-size: 1.4em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}

.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.frame-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.frame-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.frame-title h4 {
    color: #fff;
    font-size: 1.2em;
    margin: 0 0 0.25rem 0;
}

.manufacturer {
    color: #888;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.frame-class {
    color: #6a9ec7;
    font-size: 0.9em;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    background: #252525;
    border: 1px solid #444;
    border-radius: 3px;
}

.frame-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0.75rem;
    background: #252525;
    border-radius: 4px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    color: #888;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.2em;
    font-weight: 500;
}

.frame-special {
    color: #aaa;
    font-size: 0.9em;
    line-height: 1.4;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.special-label {
    color: #6a9ec7;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .frame-grid {
        grid-template-columns: 1fr;
    }

    .frame-card {
        padding: 1rem;
    }

    .frame-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .frame-class {
        align-self: flex-start;
    }

    .stat-group {
        padding: 0.5rem;
    }
}

/* Basic Tables */
.mechanics-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.mechanics-table th {
    background: var(--bg-raised);
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85em;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}

.mechanics-table td {
    padding: 1rem 1.25rem;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.mechanics-table tr:last-child td {
    border-bottom: none;
}

.mechanics-table tr:nth-child(even) {
    background: var(--bg-raised);
}

.mechanics-table tr:hover {
    background: var(--bg-raised);
}

/* Specific column styles for mechanics tables */
.mechanics-table td:first-child { /* First column (usually numbers or fuel) */
    font-family: var(--font-mono);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    width: 60px;
}

.mechanics-table td:nth-child(2) { /* Title column */
    font-weight: 500;
    color: var(--accent);
}

.mechanics-table td:nth-child(3) { /* Description column */
    color: var(--ink-soft);
}

/* Mobile adjustments for mechanics tables */
@media (max-width: 768px) {
    .mechanics-table {
        font-size: 0.95rem;
    }

    .mechanics-table th,
    .mechanics-table td {
        padding: 0.75rem 0.5rem;
    }

    .mechanics-table td:first-child {
        width: 40px;
    }
}

/* Typography Improvements */
.document-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0 0 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    border-bottom: none;
    padding-bottom: 0;
}

.content-container.fuel-layout .rules-part-content h1,
.content-container.fuel-layout .rules-part-content h1.highlight {
    font-size: 2rem;
    line-height: 1.3;
    margin: 1.5rem 0 1rem;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    background: none;
    font-style: normal;
}

/* Mobile Typography Adjustments */
@media (max-width: 768px) {
    .document-header h1 {
        font-size: 2rem;
        margin: 0 0 1rem;
    }

    .content-container.fuel-layout .rules-part-content h1 {
        font-size: 1.75rem;
        margin: 1.25rem 0 1rem;
    }
}

/* Paragraphs and Text */
.content-container.fuel-layout p {
    margin-bottom: 1.5rem;
    max-width: 70ch;
}

.content-container.fuel-layout li {
    margin-bottom: 0.75rem;
    max-width: 65ch;
}

/* Blockquotes */
.content-container.fuel-layout blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-raised);
    font-style: italic;
    color: var(--ink-soft);
}

.content-container.fuel-layout blockquote p {
    margin: 0;
}

/* Lists */
.content-container.fuel-layout ul,
.content-container.fuel-layout ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

/* Code and Technical Text */
.content-container.fuel-layout code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: var(--bg-raised);
    border-radius: 3px;
    color: var(--accent);
}

/* Mobile Typography Adjustments */
@media (max-width: 768px) {
    .content-container.fuel-layout {
        font-size: 1rem;
        line-height: 1.6;
    }

    .content-container.fuel-layout h1 {
        font-size: 2rem;
        margin: 2rem 0 1.25rem;
    }

    .content-container.fuel-layout h2 {
        font-size: 1.75rem;
        margin: 1.75rem 0 1rem;
    }

    .content-container.fuel-layout h3 {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem;
    }

    .content-container.fuel-layout h4 {
        font-size: 1.2rem;
        margin: 1.25rem 0 1rem;
    }

    .mechanics-table {
        font-size: 0.95rem;
    }
}

/* Embedded Content */
.content-container.fuel-layout iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    margin: 2rem auto;
    display: block;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Media Inspiration Section */
.content-container.fuel-layout h1 + h2 {
    margin-top: 3rem;
}

/* Target the main list items */
.content-container.fuel-layout h2 + ul > li,
.content-container.fuel-layout h2 + ul > li > strong {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
    display: block;
}

/* Target the nested list items */
.content-container.fuel-layout h2 + ul > li > ul > li {
    margin-bottom: 0.5rem;
    padding-left: 0;
    border-left: none;
    font-size: 0.95em;
    color: var(--ink-soft);
    list-style-type: '- ';
}

/* Remove default list styling */
.content-container.fuel-layout h2 + ul {
    list-style: none;
    padding-left: 0;
}

.content-container.fuel-layout h2 + ul > li > ul {
    margin-top: 0.5rem;
    padding-left: 1rem;
    list-style: none;
}

/* Mobile adjustments for embedded content */
@media (max-width: 768px) {
    .content-container.fuel-layout iframe {
        height: 200px;
    }
}

/* Tag System */
.tag-highlight {
    color: #6a9ec7;
    cursor: pointer;
    text-decoration: none;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    background: rgba(106, 158, 199, 0.1);
    border: 1px solid rgba(106, 158, 199, 0.2);
    transition: all 0.2s ease;
    display: inline-block;
    margin: 0 0.1rem;
    position: relative;
}

.tag-highlight:hover {
    color: #8ab7e0;
    background: rgba(106, 158, 199, 0.2);
    border-color: rgba(106, 158, 199, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 2px;
    background: #6a9ec7;
    transition: width 1s linear;
    opacity: 0;
}

.tag-highlight.hovering::after {
    opacity: 1;
    width: 100%;
}

.tag-popup {
    position: fixed;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem;
    width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
}

.tag-popup.visible {
    opacity: 1;
    transform: translateY(0);
}

.tag-popup.sticky {
    cursor: move;
    pointer-events: all;
}

.tag-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    cursor: move;
}

.tag-popup-title {
    color: #6a9ec7;
    font-weight: bold;
    font-size: 1.1em;
    user-select: none;
    flex: 1;
}

.tag-popup-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8em;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
    opacity: 0;
    border-radius: 2px;
    margin-left: 0.5rem;
}

.tag-popup.sticky .tag-popup-close {
    opacity: 0.6;
}

.tag-popup-close:hover {
    opacity: 1;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.tag-popup-content {
    margin-bottom: 0.5rem;
    color: #ddd;
}

.tag-popup-example {
    font-style: italic;
    color: #888;
    padding-top: 0.5rem;
    border-top: 1px solid #333;
    font-size: 0.9em;
}

/* Glossary highlighting */
#part-tag-glossary .highlight {
    background: rgba(106, 158, 199, 0.2);
    transition: background 0.5s ease;
    padding: 0.5rem;
    border-radius: 4px;
}

#part-tag-glossary .highlight::before {
    content: '→';
    color: #6a9ec7;
    margin-right: 0.5rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tag-popup {
        width: 90%;
        max-width: 300px;
        left: 50% !important;
        transform: translateX(-50%) translateY(5px);
    }

    .tag-popup.visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* Tag Glossary */
.tag-category {
    margin: 2rem 0;
}

.tag-category h3 {
    color: #6a9ec7;
    font-size: 1.2em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}

.tag-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.tag-entry {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem;
    transition: background-color 0.2s ease;
}

.tag-entry:target {
    background: #252525;
    border-color: #6a9ec7;
}

.tag-name {
    color: #6a9ec7;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 0.5rem;
}

.tag-description {
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.tag-example {
    color: #888;
    font-size: 0.9em;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

.tag-example em {
    color: #6a9ec7;
    font-style: normal;
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .tag-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Override syntax highlighting styles */
.content-container.fuel-layout pre.highlight {
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    font-size: inherit;
    line-height: inherit;
}

.content-container.fuel-layout .highlight {
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    font-size: inherit;
    line-height: inherit;
} 