/* Custom circuit board pattern for technology/engineering theme */
.circuit-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23198341' fill-opacity='0.08' d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z'%3E%3C/path%3E%3C/svg%3E");
}

/* Content styling */
.content-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3c39;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #c2e5c9;
}

.content-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3c39;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.content-body p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.content-body ul,
.content-body ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-left: 1.5rem;
}

.content-body ul li,
.content-body ol li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #4a5568;
}

.content-body pre {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

.content-body code {
    background-color: #f9fafb;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    color: #198341;
    font-family: monospace;
    font-size: 0.875rem;
}

.content-body blockquote {
    padding-left: 1rem;
    border-left: 4px solid #9fd7a8;
    font-style: italic;
    margin: 1.5rem 0;
    color: #4b5563;
}

.content-body img {
    border-radius: 0.5rem;
    margin: 1.5rem auto;
    max-width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.content-body th {
    background-color: #f9fafb;
    padding: 0.5rem 1rem;
    text-align: left;
    color: #4b5563;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.content-body td {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
}

/* Animation utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: #198341;
    z-index: 50;
    transition: width 0.2s ease;
}

/* Custom scroll indicator dots */
.section-dots {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 40;
}

.section-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-dot.active {
    background-color: #198341;
    height: 24px;
}

/* Table of contents */
.toc {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3c39;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.toc-link {
    display: block;
    padding: 0.375rem 0.75rem;
    color: #4b5563;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.toc-link:hover {
    color: #198341;
}

.toc-link.active {
    background-color: #e6f3ea;
    color: #198341;
    font-weight: 500;
}

/* Custom scrollbar for the ToC */
.toc::-webkit-scrollbar {
    width: 4px;
}

.toc::-webkit-scrollbar-track {
    background-color: #f3f4f6;
    border-radius: 0.25rem;
}

.toc::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 0.25rem;
}

.toc::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Highlight box */
.highlight-box {
    background-color: #e6f3ea;
    border-left: 4px solid #198341;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
}

/* Image zoom effect */
.zoom-hover {
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.zoom-hover:hover {
    transform: scale(1.02);
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-item {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 9999px;
    background-color: #e6f3ea;
    color: #198341;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3c39;
    margin-bottom: 0.5rem;
}

/* Floating action buttons */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 40;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 9999px;
    background-color: white;
    color: #198341;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #198341;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.action-button:hover {
    background-color: #198341;
    color: white;
    transform: scale(1.1);
}

.action-button.primary {
    background-color: #198341;
    color: white;
}

.action-button.primary:hover {
    background-color: #145c2c;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
}

/* Related content */
.related-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.related-item:hover {
    background-color: #f9fafb;
}

.related-image {
    width: 80px;
    height: 80px;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-item:hover .related-image img {
    transform: scale(1.1);
}

.reading-time-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: #198341;
    color: white;
    border-radius: 9999px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
}

.category-badge:hover {
    background-color: #145c2c;
}

/* Lightbox for images */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .content-main {
        width: 100% !important;
    }

    body {
        background: white !important;
    }

    .content-body {
        font-size: 12pt !important;
    }

    .content-body a {
        text-decoration: underline;
        color: #000 !important;
    }

    .content-body h2,
    .content-body h3 {
        page-break-after: avoid;
    }

    .content-body img {
        max-width: 500px !important;
    }
}
