:root {
    /* Cybersecurity Theme Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #13182b;
    --bg-card: #1a2036;
    --text-primary: #ffffff;
    --text-secondary: #a0a8c2;
    --text-muted: #6b7280;
    --accent-green: #10b981;
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --border-color: #2d3748;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --code-bg: #1e293b;
    --terminal-bg: #0f172a;
}

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

/* Global link styling - FIX for blue links */
a, a:link, a:visited, a:hover, a:active, a:focus {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    gap: 3rem;
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 1rem;
    position: relative;
    overflow: visible;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--accent-green) 0%, 
        var(--accent-cyan) 25%, 
        var(--accent-blue) 50%, 
        var(--accent-purple) 75%, 
        var(--accent-red) 100%);
}

.site-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.site-tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1000;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
}

.nav-link:hover::before {
    width: 80%;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.dropdown-btn::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.open .dropdown-btn::after {
    transform: rotate(180deg);
}

.dropdown-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    min-width: 220px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: visible;
    margin-top: 5px;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding-left: 1.25rem;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 auto 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Main Content */
.content {
    flex: 1;
    min-width: 0;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.post-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.post-content a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--accent-green);
}

/* Sidebar */
aside {
    width: 300px;
    flex-shrink: 0;
}

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

.sidebar-section h3 {
    color: var(--accent-cyan);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Social Links */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.social-links a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateX(5px);
}

.social-links i {
    width: 20px;
    text-align: center;
}

/* Recent Posts */
.recent-posts {
    list-style: none;
}

.recent-posts li {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.recent-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-posts a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.recent-posts a:hover {
    color: var(--accent-cyan);
}

/* List Layout */
.list-page {
    padding: 2rem 0;
}

.list-header {
    margin-bottom: 3rem;
    text-align: center;
}

.list-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.list-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 2px;
}

.list-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.list-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-green), var(--accent-cyan));
    transition: width 0.3s ease;
}

.list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.list-item:hover::before {
    width: 8px;
}

.list-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.list-item h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.list-item:hover h2 {
    color: var(--accent-cyan);
}

.list-item p {
    color: var(--text-secondary);
    margin: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

.list-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.list-date {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.list-category {
    color: var(--accent-green);
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.footer-links a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-cyan);
    color: white !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    font-size: 1.2rem;
}

.back-to-top:hover {
    background: var(--bg-primary);
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
    color: var(--accent-cyan) !important;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
}

.cta-box h2 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.cta-box ul {
    list-style: none;
    margin: 1.5rem 0;
}

.cta-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.cta-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

.cta-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-green);
    margin: 1.5rem 0;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    color: white !important;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
    color: white !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        gap: 2rem;
    }
    
    aside {
        width: 100%;
    }
    
    .list-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .main-nav {
        display: none;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        background: var(--bg-card);
        border-radius: 8px;
        margin-top: 1rem;
        align-items: stretch;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 8px;
        margin-top: 0.5rem;
        animation: none;
        margin-left: 0;
    }
    
    .list-grid {
        grid-template-columns: 1fr;
    }
    
    .list-title {
        font-size: 2rem;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Code Blocks */
pre {
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

pre::before {
    content: 'bash';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-cyan);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-bottom-left-radius: 8px;
}

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

/* Utility Classes */
.text-gradient {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-ctf {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.badge-writeup {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.badge-bugbounty {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

/* Ensure icons have proper spacing */
.nav-link i,
.dropdown-btn i,
.footer-links a i,
.social-links a i,
.dropdown-content a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Fix visited links globally */
a:visited {
    color: var(--text-secondary) !important;
}

a:hover {
    color: var(--accent-cyan) !important;
}

/* Specific overrides for navigation */
.nav-link,
.dropdown-btn,
.footer-links a,
.social-links a,
.dropdown-content a {
    color: var(--text-secondary) !important;
}

.nav-link:hover,
.dropdown-btn:hover,
.footer-links a:hover,
.social-links a:hover,
.dropdown-content a:hover {
    color: var(--text-primary) !important;
}

/* Fix for post content links */
.post-content a:visited {
    color: var(--accent-cyan) !important;
}

.post-content a:hover {
    color: var(--accent-green) !important;
}
