body {
    font-family: 'Inter', sans-serif;
    background-color: #111827; /* bg-gray-900 */
    color: #D1D5DB; /* text-gray- 300 */
}

.font-mono {
    font-family: 'Roboto Mono', monospace;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #38bdf8; /* light-blue-400 */
        transition: width 0.3s ease;
    }

    .nav-link:hover::after, .nav-link.active::after {
        width: 100%;
    }

/* Override the general rule for dropdown items */
.relative.group > .nav-link::after {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Fix for dropdown nav-link active state */
.relative.group .nav-link.active {
    position: relative !important;
}

.relative.group .nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    width: 100% !important;
    height: 2px !important;
    bottom: -4px !important;
    left: 0 !important;
    background-color: #38bdf8 !important;
    transition: width 0.3s ease !important;
}

/* Even more specific rule for articles dropdown */
div.relative.group > a.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    width: 100% !important;
    height: 2px !important;
    bottom: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #38bdf8 !important;
    transition: width 0.3s ease !important;
    z-index: 10 !important;
}

.glow-border {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.tag-beginner {
    background-color: #166534;
    color: #bbf7d0;
}
/* green */
.tag-intermediate {
    background-color: #9a3412;
    color: #fdba74;
}
/* orange */
.tag-advanced {
    background-color: #991b1b;
    color: #fecaca;
}
/* red */

/* Dropdown hover fix */
.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

.group:hover .group-hover\:visible {
    visibility: visible !important;
}

/* Improve dropdown hover zone - eliminate gaps that break hover state */
.group .absolute {
    /* Ensure dropdown starts immediately at button bottom */
    margin-top: 0;
}

/* Add a small invisible bridge to prevent hover loss when moving to dropdown */
.group::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -2rem;
    right: -2rem;
    height: 2px;
    z-index: 40;
}

/* Ensure dropdown appears above the bridge */
.group .absolute {
    z-index: 50;
}

.category-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid transparent;
}

.category-malware {
    border-color: #f43f5e;
    color: #f43f5e;
}
/* rose-500 */
.category-re {
    border-color: #8b5cf6;
    color: #8b5cf6;
}
/* violet-500 */
.category-exploit {
    border-color: #dc2626;
    color: #dc2626;
}
/* red-600 */
.category-secure {
    border-color: #0ea5e9;
    color: #0ea5e9;
}
/* sky-500 */
.category-forensics {
    border-color: #06b6d4;
    color: #06b6d4;
}
/* cyan-500 */
.category-ctf {
    border-color: #f59e0b;
    color: #f59e0b;
}
/* amber-500 */
.category-theory {
    border-color: #6b7280;
    color: #6b7280;
}
/* gray-500 */
.category-tools {
    border-color: #10b981;
    color: #10b981;
}
/* emerald-500 */
.category-crackme {
    border-color: #f97316;
    color: #f97316;
}
/* orange-500 */
.category-thm {
    border-color: #059669;
    color: #059669;
}
/* emerald-600 */
.category-htb {
    border-color: #7c3aed;
    color: #7c3aed;
}
/* violet-600 */
.category-asm {
    border-color: #22c55e;
    color: #22c55e;
}
/* green-500 */
.category-python {
    border-color: #eab308;
    color: #eab308;
}
/* yellow-500 */
.category-js {
    border-color: #eab308; /* yellow-500 */
    color: #eab308;
}
.category-web {
    border-color: #3b82f6; /* blue-500 */
    color: #3b82f6;
}
.category-cpp {
    border-color: #6366f1; /* indigo-500 */
    color: #6366f1;
}
.category-windows {
    border-color: #14b8a6; /* teal-500 */
    color: #14b8a6;
}
.category-dotnet {
    border-color: #a855f7; /* purple-500 */
    color: #a855f7;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Custom animation for page transitions */
.page-content {
    animation: fadeIn 0.5s ease-in-out;
}

.page-content.hidden {
    display: none;
}

.page-content.shown {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Smooth Transition Classes --- */
.page-content, .article-card {
  transition: opacity 0.2s ease-in-out;
}

.fade-out {
  opacity: 0;
}

/* Article page specific styles */
.prose {
    line-height: 1.8;
}

.prose h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose pre {
    margin: 1.5rem 0;
    border: 1px solid #374151;
}

.prose code {
    background-color: #374151;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

/* External content styling */
.external-content {
    color: #1f2937 !important; /* dark text for white background */
}

.external-content h1 {
    color: #111827 !important; /* dark heading for white background */
    font-weight: bold !important;
    margin: 2rem 0 !important;
}

.external-content h2 {
    color: #111827 !important; /* dark heading for white background */
    font-weight: bold !important;
    margin: 2rem 0 1rem 0 !important;
}

.external-content h3 {
    color: #111827 !important; /* dark heading for white background */
    font-weight: bold !important;
    margin: 1.5rem 0 1rem 0 !important;
}

.external-content h4, .external-content h5, .external-content h6 {
    color: #374151 !important; /* gray heading for white background */
    font-weight: 600 !important;
    margin: 1rem 0 0.5rem 0 !important;
}

.external-content p {
    color: #1f2937 !important; /* dark text for white background */
    margin-bottom: 1rem !important;
    line-height: 1.8 !important;
}

.external-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem !important;
    margin: 1rem auto !important;
    display: block !important;
}

.external-content table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1rem 0 !important;
}

.external-content td, .external-content th {
    border: 1px solid #d1d5db !important; /* lighter border for white background */
    padding: 0.5rem !important;
    color: #1f2937 !important; /* dark text for white background */
}

.external-content pre {
    background-color: #111827 !important;
    border: 1px solid #374151 !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    overflow-x: auto !important;
    margin: 1rem 0 !important;
}

.external-content code {
    background-color: #374151 !important;
    color: #88fecf !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.25rem !important;
    font-family: 'Courier New', monospace !important;
}

/* Article-specific overrides for Google Docs content */
.article-body-content {
    /* Set white background for the article content area */
    background-color: white !important;
}

/* Override Google Docs colors but preserve ALL sizing and layout */
.article-body-content * {
    /* Force white background for all elements to override Google Docs backgrounds */
    background-color: white !important;
}

/* Target specific Google Docs color attributes while preserving everything else */
.article-body-content p,
.article-body-content div,
.article-body-content span,
.article-body-content li {
    /* Only override color, preserve font-size, margins, etc. */
    color: #1f2937 !important; /* gray-800 for good contrast on white */
}

.article-body-content h1,
.article-body-content h2,
.article-body-content h3,
.article-body-content h4,
.article-body-content h5,
.article-body-content h6 {
    /* Only override color for headings, keep all Google Docs sizing */
    color: #111827 !important; /* gray-900 for strong contrast */
}

.article-body-content a {
    /* Style links appropriately for white background */
    color: #0ea5e9 !important; /* sky-500 */
    text-decoration: underline;
}

.article-body-content a:hover {
    color: #0284c7 !important; /* sky-600 */
}

/* Make sure tables are readable on white background */
.article-body-content table,
.article-body-content td,
.article-body-content th {
    background-color: white !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

/* Article container width adjustment */
#article-container {
    width: fit-content;
}

/* Enhanced code block styling for better readability */
.code-block {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    padding: 16px !important;
    border-radius: 8px !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    overflow-x: auto !important;
    white-space: pre !important;
    border: 1px solid #374151 !important;
    margin: 16px 0 !important;
}

.code-block::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #111827;
}

.code-block::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Ensure footer stays with dark theme */
footer {
    background-color: #1f2937 !important; /* gray-800 */
}

footer * {
    background-color: inherit !important;
}

/* News item styling */
.news-item {
    padding: 1.5rem; /* p-6 equivalent */
}

.news-item.recent-card {
    padding: 2rem; /* p-8 equivalent for recent news */
}

/* Loading spinner animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #374151;
    border-top: 2px solid #38bdf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message styling */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.error-message button {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

.error-message button:hover {
    background-color: #dc2626;
}