:root {
    --bg-dark: #070709;
    --bg-card: rgba(20, 20, 25, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.2);
    --easy-green: #22c55e;
    --medium-yellow: #f59e0b;
    --hard-red: #f43f5e;
    
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

.grid-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

/* Header */
.site-header {
    position: fixed;
    top: 0; width: 100%;
    background: rgba(7, 7, 9, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.brand-text span {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.brand-text .sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-red);
    letter-spacing: 3px;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Main Content */
.page-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 24px 60px;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.badge-wrapper {
    margin-bottom: 24px;
}

.badge {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    padding: 6px 16px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pulse {
    width: 8px; height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-red);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.gradient-text {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Controls (Filters & Search) */
.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.actions-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

.search-box input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px 10px 38px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.05);
}

.info-btn {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--easy-green);
    padding: 10px 20px;
}

.info-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--easy-green);
    color: var(--easy-green);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

/* Lab Grid */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* HTB Style Card */
.lab-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.lab-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: background 0.3s ease;
}

.lab-card:hover {
    transform: translateY(-5px);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(239, 68, 68, 0.1);
}

.lab-card:hover::before {
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.lab-header {
    margin-bottom: 16px;
}

.lab-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-badge.easy { background: rgba(34, 197, 94, 0.1); color: var(--easy-green); border: 1px solid rgba(34, 197, 94, 0.2); }
.difficulty-badge.medium { background: rgba(245, 158, 11, 0.1); color: var(--medium-yellow); border: 1px solid rgba(245, 158, 11, 0.2); }
.difficulty-badge.hard { background: rgba(244, 63, 94, 0.1); color: var(--hard-red); border: 1px solid rgba(244, 63, 94, 0.2); }

.category-tag {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.lab-content {
    flex-grow: 1;
    margin-bottom: 24px;
}

.lab-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.lab-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.lab-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #64748b;
}

.lab-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn.docker-btn:active {
    transform: scale(0.98);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--easy-green);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--accent-red);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-red);
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.step-num {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: bold;
    flex-shrink: 0;
}

.step-text h4 {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 768px) {
    .gradient-text { font-size: 3rem; }
    .nav-links { display: none; }
    .controls-container { flex-direction: column; align-items: stretch; }
    .actions-group { flex-direction: column; }
    .search-box input { width: 100%; }
}
