:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --code-bg: #f3f4f6;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo:hover {
    color: var(--secondary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 1rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.hero h1 {
    font-size: 1.4rem;
    margin-bottom: 0;
    font-weight: 600;
}

.hero p {
    font-size: 0.85rem;
    max-width: 420px;
    margin: 0.25rem auto 0.5rem;
    opacity: 0.75;
}

.category-buttons {
    background: white;
    padding: 1rem 0 1.5rem;
}

.category-buttons p {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.category-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    background: white;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    aspect-ratio: 1 / 1;
    min-height: 120px;
    text-align: center;
    padding: 0.65rem 0.5rem;
    box-sizing: border-box;
}

.category-button span {
    text-transform: none;
}

.category-button:hover,
.category-button:focus-visible {
    transform: translateY(-2px);
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}
.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
}

.search-box input:focus {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.email-capture {
    margin-top: 1.5rem;
    text-align: center;
}

.email-capture label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.email-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.email-row input {
    flex: 1;
    min-width: 220px;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    max-width: 320px;
}

.email-row button {
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 999px;
    background-color: white;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.email-row button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.email-message {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.email-message.success {
    color: #aee6b7;
}

.email-message.error {
    color: #fecaca;
}

/* Main Content */
main {
    padding: 3rem 0;
}

.category-section {
    margin-bottom: 4rem;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.category-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.category-icon.svg-icon {
    width: 2rem;
    height: 2rem;
    display: inline-block;
    color: var(--primary-color);
}

.category-icon.svg-icon svg {
    width: 100%;
    height: 100%;
}

.category-header h2 {
    font-size: 2rem;
    color: var(--text-color);
}

.cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cheatsheet-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.cheatsheet-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.cheatsheet-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.cheatsheet-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Cheat Sheet Page Styles */
.cheatsheet-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.cheatsheet-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.cheatsheet-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .btn-icon {
    font-size: 1.2rem;
}

@media print {
    .action-buttons {
        display: none !important;
    }
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 1;
}

.cheatsheet-content {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.related-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.related-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.related-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.related-card h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.related-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.section h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 1.5rem 0 0.75rem;
}

.command-list, .reference-table {
    margin: 1rem 0;
}

.command-item {
    background: var(--code-bg);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.command-item code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.command-item .description {
    margin-top: 0.5rem;
    color: var(--text-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--code-bg);
    font-weight: 600;
    color: var(--text-color);
}

tr:hover {
    background-color: var(--bg-light);
}

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
}

.tip-box {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.tip-box strong {
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Print Styles */
@media print {
    header, footer, .search-box, .back-link {
        display: none;
    }

    .cheatsheet-content {
        box-shadow: none;
        padding: 0;
    }

    body {
        background: white;
    }

    .cheatsheet-header {
        background: none;
        color: black;
        padding: 1rem 0;
    }

    .command-item {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .cheatsheet-grid {
        grid-template-columns: 1fr;
    }

    .cheatsheet-header h1 {
        font-size: 1.75rem;
    }

    .category-header h2 {
        font-size: 1.5rem;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumbs a {
    color: white;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    opacity: 0.7;
}

/* Related Sheets Section */
.related-sheets {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.related-sheets h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.related-sheets ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.related-sheets li {
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.related-sheets li:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.related-sheets a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.related-sheets a:hover {
    color: var(--primary-color);
}

.related-sheets .browse-more {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 1rem;
}

.related-sheets .browse-more a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Back to Category Links */
.back-to-category {
    text-align: center;
    padding: 1.5rem;
    margin: 2rem 0;
    background: var(--bg-light);
    border-radius: 8px;
}

.back-to-category a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
}

.back-to-category a:hover {
    text-decoration: underline;
}

/* Footer */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
    padding: 2rem 0;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 2rem;
}

/* Page Header (for categories, etc.) */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.page-header .count {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
    color: var(--secondary-color);
}

.category-card .category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.category-card .category-icon.svg-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.category-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.category-card h3 a:hover {
    color: var(--secondary-color);
}

.category-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.category-card .category-count {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Category Page Layout */
.category-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.category-main {
    min-width: 0;
}

.category-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.category-links {
    list-style: none;
}

.category-links li {
    margin-bottom: 0.5rem;
}

.category-links a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.category-links a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Cheatsheet List (for category pages) */
.cheatsheet-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cheatsheet-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.cheatsheet-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.cheatsheet-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.cheatsheet-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.cheatsheet-item h3 a:hover {
    color: var(--secondary-color);
}

.cheatsheet-item p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.cheatsheet-item .keywords {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Active nav item */
nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        position: static;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .related-sheets ul {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

/* Improved Hero Section */
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem !important;
    max-width: 700px !important;
    margin: 0 auto 2rem !important;
    opacity: 0.95 !important;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
}

.hero-search input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    font-size: 1rem;
    border-radius: 50px;
    outline: none;
    color: var(--text-color);
}

.hero-search .search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.3s;
}

.hero-search .search-btn:hover {
    background: var(--secondary-color);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.btn-primary:hover {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* Email Capture Improvements */
.email-capture {
    max-width: 500px;
    margin: 2rem auto 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.email-wrapper label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.email-row {
    display: flex;
    gap: 0.5rem;
}

.email-row input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
}

.email-row input:focus {
    outline: none;
    border-color: white;
    background: white;
}

.email-row button {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.email-row button:hover {
    background: var(--secondary-color);
}

.privacy-note {
    margin-top: 0.5rem !important;
    font-size: 0.75rem !important;
    opacity: 0.8 !important;
    text-align: center;
}

.email-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
}

.email-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.email-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Print-Friendly Styles */
@media print {
    header, .hero, .email-capture, .category-buttons, footer, nav {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .cheatsheet-content {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    a {
        color: black !important;
        text-decoration: none !important;
    }

    .no-print {
        display: none !important;
    }
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    .hero-cta {
        flex-direction: column;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
    }

    .email-row {
        flex-direction: column;
    }

    .email-row button {
        width: 100%;
    }

    .button-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* All Cheat Sheets Page Enhancements */
.sitemap-header {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
}

.sitemap-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.sitemap-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.filters-bar {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 300px;
}

.filter-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-category select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0 2rem;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
}

.result-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-left: auto;
}

/* Sortable Table */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem !important;
}

.sortable-header::after {
    content: '⇅';
    position: absolute;
    right: 0.75rem;
    opacity: 0.3;
}

.sortable-header:hover::after {
    opacity: 0.6;
}

.sortable-header.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary-color);
}

.sortable-header.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary-color);
}

/* Pagination */
.pagination-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.page-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--text-light);
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .sitemap-table {
        font-size: 0.9rem;
    }

    .sitemap-table th,
    .sitemap-table td {
        padding: 0.5rem;
    }

    .description-col {
        display: none;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search,
    .filter-category select {
        width: 100%;
    }

    .result-count {
        margin: 0;
        text-align: center;
    }

    .pagination-controls {
        font-size: 0.9rem;
    }

    .page-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 1rem;
}

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

/* Favorites System */
.favorite-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.favorite-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.favorite-toggle.favorited {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

.favorite-toggle.favorited .favorite-icon {
    color: #FFD700;
    animation: star-pop 0.3s ease;
}

@keyframes star-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.favorite-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Favorites count badge in navbar */
.favorites-link {
    position: relative;
}

.favorites-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Favorites page styles */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.favorite-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
}

.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.favorite-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.favorite-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.favorite-card h3 a:hover {
    color: var(--secondary-color);
}

.favorite-card .category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.favorite-card .added-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.favorite-card .remove-favorite {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.favorite-card .remove-favorite:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Data management buttons */
.data-controls {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.data-control-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.data-control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.data-control-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: 1fr;
    }

    .toast-notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Reset for print */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide non-essential elements */
    header,
    nav,
    footer,
    .nav-search,
    .breadcrumbs,
    .cheatsheet-actions,
    .favorite-toggle,
    .share-buttons,
    .data-controls,
    .category-button,
    .search-btn,
    button,
    .toast-notification,
    #favorites-count {
        display: none !important;
    }

    /* Page setup */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    body {
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    /* Headings */
    h1 {
        font-size: 20pt;
        margin-bottom: 12pt;
        page-break-after: avoid;
    }

    h2 {
        font-size: 16pt;
        margin-top: 18pt;
        margin-bottom: 8pt;
        page-break-after: avoid;
        border-bottom: 1pt solid #000;
        padding-bottom: 4pt;
    }

    h3 {
        font-size: 13pt;
        margin-top: 12pt;
        margin-bottom: 6pt;
        page-break-after: avoid;
    }

    h4 {
        font-size: 11pt;
        margin-top: 10pt;
        margin-bottom: 4pt;
        page-break-after: avoid;
    }

    /* Avoid breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    /* Code blocks */
    pre, code {
        font-family: 'Courier New', Courier, monospace;
        font-size: 9pt;
        border: 1pt solid #000;
        padding: 8pt;
        page-break-inside: avoid;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    code {
        padding: 2pt 4pt;
        background: #f0f0f0 !important;
    }

    /* Tables */
    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: avoid;
        margin: 12pt 0;
    }

    th, td {
        border: 1pt solid #000;
        padding: 6pt;
        text-align: left;
    }

    th {
        background: #e0e0e0 !important;
        font-weight: bold;
    }

    /* Lists */
    ul, ol {
        margin: 8pt 0;
        padding-left: 24pt;
    }

    li {
        margin: 4pt 0;
    }

    /* Links */
    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-style: italic;
    }

    /* Hide internal links' URLs */
    a[href^="/"]:after,
    a[href^="#"]:after {
        content: "";
    }

    /* Content sections */
    .cheatsheet-section {
        page-break-inside: avoid;
        margin-bottom: 18pt;
    }

    .example-box {
        border: 1pt solid #000;
        padding: 10pt;
        margin: 12pt 0;
        page-break-inside: avoid;
    }

    /* Category badges */
    .category-badge {
        border: 1pt solid #000;
        padding: 2pt 6pt;
        display: inline-block;
        margin-bottom: 8pt;
    }

    /* Grid layouts - convert to single column */
    .grid,
    .sheets-grid,
    .tools-grid,
    .categories-grid {
        display: block !important;
    }

    .grid > *,
    .sheets-grid > *,
    .tools-grid > *,
    .categories-grid > * {
        display: block !important;
        width: 100% !important;
        margin-bottom: 12pt !important;
        page-break-inside: avoid;
    }

    /* Container */
    .container {
        max-width: 100%;
        padding: 0;
    }

    /* Cheatsheet header */
    .cheatsheet-header {
        margin-bottom: 18pt;
        padding-bottom: 10pt;
        border-bottom: 2pt solid #000;
    }

    .cheatsheet-header h1 {
        margin-bottom: 6pt;
    }

    /* Print-specific title page */
    .print-title {
        page-break-after: always;
        text-align: center;
        padding-top: 30%;
    }

    /* Page numbers */
    .page-number {
        position: fixed;
        bottom: 0;
        right: 0;
        font-size: 9pt;
    }
}
