/* Base styles */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --card-bg: #1a1a1a;
    --card-hover: #252525;
    --accent-color: #00ff00;
    --gradient-start: #8a2be2; /* Deep Purple */
    --gradient-end: #da70d6;   /* Orchid Purple */
    --secondary-text: #aaaaaa;
    --section-gap: 30px;
    --badge-color: #333;
    --badge-text: #999;
    --font-family: 'DM Mono', monospace;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.light-theme {
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg: #f0f0f0;
    --card-hover: #e5e5e5;
    --secondary-text: #555555;
    --badge-color: #eee;
    --badge-text: #666;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

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

/* Header */
header {
    margin-bottom: var(--section-gap);
    text-align: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: normal;
}

.title {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Newsletter section */
.newsletter {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: var(--section-gap);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
    transition: padding 0.5s ease, height 0.5s ease;
}

.newsletter.shrink {
    padding-top: 10px;
    padding-bottom: 10px;
    height: 60px;
    overflow: hidden;
}

.newsletter.compact {
    padding: 12px 20px;
    height: auto;
}

.newsletter.compact h2 {
    margin-bottom: 0;
    font-size: 1rem;
}

.newsletter h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-align: center;
}

.newsletter p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
}

.signup-form {
    width: 100%;
    transition: opacity 0.3s ease;
}

.input-group {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    font-family: var(--font-family);
    color: white;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-group button {
    background: none;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-size: 1.2rem;
    font-family: var(--font-family);
    color: white;
}

/* Section styling */
.section {
    margin-bottom: var(--section-gap);
}

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

.section h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.section h3:first-child {
    margin-top: 0;
}

.section ul {
    margin: 0 0 1.5rem 1.2rem;
    padding: 0;
}

.section li {
    margin-bottom: 0.75rem;
}

.video-embed {
    position: relative;
    margin: 2.5rem 0;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.section-title {
    font-size: 0.8rem;
    text-transform: lowercase;
    color: var(--secondary-text);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--card-bg);
}

/* Code blocks */
.code-block {
    margin: 15px 0;
    border-radius: 5px;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    padding: 15px;
    background-color: rgba(20, 40, 30, 0.9);
    border-radius: 5px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-family);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Syntax highlighting */
.code-block .keyword,
.code-block .def {
    color: #ff79c6; /* Pink */
}

.code-block .operator {
    color: #ff79c6;
}

.code-block .string {
    color: #f1fa8c; /* Yellow */
}

.code-block .number {
    color: #bd93f9; /* Purple */
}

.code-block .function {
    color: #50fa7b; /* Green */
}

.code-block .comment {
    color: #6272a4; /* Light blue-gray */
    font-style: italic;
}

.code-block .class {
    color: #8be9fd; /* Cyan */
}

.code-block .property {
    color: #f8f8f2; /* White */
}

.light-theme .code-block pre {
    background-color: rgba(220, 240, 230, 0.9);
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.light-theme .code-block .keyword,
.light-theme .code-block .def {
    color: #d73a49; /* Red */
}

.light-theme .code-block .operator {
    color: #d73a49;
}

.light-theme .code-block .string {
    color: #032f62; /* Dark blue */
}

.light-theme .code-block .number {
    color: #6f42c1; /* Purple */
}

.light-theme .code-block .function {
    color: #22863a; /* Green */
}

.light-theme .code-block .comment {
    color: #6a737d; /* Gray */
    font-style: italic;
}

.light-theme .code-block .class {
    color: #0086b3; /* Blue */
}

.light-theme .code-block .property {
    color: #24292e; /* Dark gray */
}

/* Link cards */
.links, .projects {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-card, .project-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 5px;
    transition: background-color 0.2s;
    position: relative;
}

.link-card:hover, .project-card:hover {
    background-color: var(--card-hover);
}

.icon {
    min-width: 30px;
    text-align: center;
    font-size: 1.2rem;
    margin-right: 15px;
}

.link-content, .project-content {
    flex: 1;
}

.link-content h4, .project-content h4 {
    font-size: 0.9rem;
    font-weight: 500;
}

.link-content p, .project-content p {
    font-size: 0.8rem;
    color: var(--secondary-text);
}

/* Acquired badge */
.acquired .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    background-color: var(--badge-color);
    color: var(--badge-text);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.theme-toggle button {
    background: var(--card-bg);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    font-family: var(--font-family);
}

.theme-toggle button:hover {
    transform: scale(1.1);
}

/* Success animation */
#signup-container {
    position: relative;
    min-height: 45px; /* Minimum height for the input field */
}

#success-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    width: 100%;
    height: 110px;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fade-in {
    opacity: 0; /* Start at 0 */
    animation: fadeIn 0.5s ease-in forwards; /* Use forwards to keep final state */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Sparkle animation */
.sparkle-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.sparkle {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center;
    opacity: 0;
}

.sparkle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: scale(0.5);
    opacity: 0.7;
}

.s1 { background-color: #ffde59; animation: sparkleAnim 0.7s ease-out 0.1s forwards, moveOutward 0.7s ease-out 0.1s forwards; }
.s2 { background-color: #ff5757; animation: sparkleAnim 0.7s ease-out 0.15s forwards, moveOutward 0.7s ease-out 0.15s forwards; }
.s3 { background-color: #48a9ff; animation: sparkleAnim 0.7s ease-out 0.2s forwards, moveOutward 0.7s ease-out 0.2s forwards; }
.s4 { background-color: #9e76ff; animation: sparkleAnim 0.7s ease-out 0.25s forwards, moveOutward 0.7s ease-out 0.25s forwards; }
.s5 { background-color: #ff7eb9; animation: sparkleAnim 0.7s ease-out 0.3s forwards, moveOutward 0.7s ease-out 0.3s forwards; }
.s6 { background-color: #7cffcb; animation: sparkleAnim 0.7s ease-out 0.35s forwards, moveOutward 0.7s ease-out 0.35s forwards; }
.s7 { background-color: #feff99; animation: sparkleAnim 0.7s ease-out 0.4s forwards, moveOutward 0.7s ease-out 0.4s forwards; }
.s8 { background-color: #ff99e6; animation: sparkleAnim 0.7s ease-out 0.45s forwards, moveOutward 0.7s ease-out 0.45s forwards; }

.s1::before { background-color: #ffde59; }
.s2::before { background-color: #ff5757; }
.s3::before { background-color: #48a9ff; }
.s4::before { background-color: #9e76ff; }
.s5::before { background-color: #ff7eb9; }
.s6::before { background-color: #7cffcb; }
.s7::before { background-color: #feff99; }
.s8::before { background-color: #ff99e6; }

@keyframes sparkleAnim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(var(--scale, 1)) rotate(45deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(90deg); }
}

@keyframes moveOutward {
    0% { top: 50%; left: 50%; }
    100% { 
        top: calc(50% + var(--y, 0px)); 
        left: calc(50% + var(--x, 0px)); 
    }
}

.s1 { --x: 40px; --y: 0px; --scale: 1.2; }
.s2 { --x: 28px; --y: 28px; --scale: 0.9; }
.s3 { --x: 0px; --y: 40px; --scale: 1.1; }
.s4 { --x: -28px; --y: 28px; --scale: 0.8; }
.s5 { --x: -40px; --y: 0px; --scale: 1.3; }
.s6 { --x: -28px; --y: -28px; --scale: 0.9; }
.s7 { --x: 0px; --y: -40px; --scale: 1.0; }
.s8 { --x: 28px; --y: -28px; --scale: 1.2; }

/* Star shape for some sparkles */
.s1, .s3, .s5, .s7 {
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%,
        79% 91%, 50% 70%, 21% 91%, 32% 57%,
        2% 35%, 39% 35%
    );
}

/* Mini sparkles */
.mini-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    background-color: white;
}

.m1 { animation: miniSparkle 0.5s ease-out 0.25s forwards, miniMove 0.5s ease-out 0.25s forwards; --mx: 20px; --my: 15px; }
.m2 { animation: miniSparkle 0.5s ease-out 0.3s forwards, miniMove 0.5s ease-out 0.3s forwards; --mx: -15px; --my: 20px; }
.m3 { animation: miniSparkle 0.5s ease-out 0.2s forwards, miniMove 0.5s ease-out 0.2s forwards; --mx: -25px; --my: -15px; }
.m4 { animation: miniSparkle 0.5s ease-out 0.35s forwards, miniMove 0.5s ease-out 0.35s forwards; --mx: 15px; --my: -25px; }
.m5 { animation: miniSparkle 0.5s ease-out 0.27s forwards, miniMove 0.5s ease-out 0.27s forwards; --mx: 35px; --my: -10px; }
.m6 { animation: miniSparkle 0.5s ease-out 0.32s forwards, miniMove 0.5s ease-out 0.32s forwards; --mx: -30px; --my: 5px; }

@keyframes miniSparkle {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
}

@keyframes miniMove {
    0% { top: 50%; left: 50%; }
    100% { 
        top: calc(50% + var(--my)); 
        left: calc(50% + var(--mx)); 
    }
}

/* Challenge and result cards with larger icons */
.challenges .icon,
.results .icon {
    font-size: 4.8rem; /* 4x the original size */
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    animation: float 6s ease-in-out infinite;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Add slight offset to create a wave effect */
.challenge-card:nth-child(odd) .icon,
.result-card:nth-child(odd) .icon {
    animation-delay: 0.5s;
}

.challenge-card:nth-child(3n) .icon,
.result-card:nth-child(3n) .icon {
    animation-delay: 1s;
}

.challenge-card:nth-child(4n) .icon,
.result-card:nth-child(4n) .icon {
    animation-delay: 1.5s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-7px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Challenge and result cards */
.challenges, .results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.challenge-card, .result-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 5px;
    transition: background-color 0.2s, transform 0.2s;
}

.challenge-card:hover, .result-card:hover {
    background-color: var(--card-hover);
    transform: translateY(-2px);
}

.challenge-content, .result-content {
    flex: 1;
}

.challenge-content h4, .result-content h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.challenge-content p, .result-content p {
    font-size: 0.85rem;
    color: var(--secondary-text);
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    
    .link-card, .project-card {
        padding: 12px;
    }
    
    .icon {
        margin-right: 10px;
    }
    
    .challenges .icon,
    .results .icon {
        font-size: 3.6rem; /* Slightly smaller on mobile */
        min-width: 50px;
        margin-right: 15px;
    }
} 
/* Global footer */
.site-footer {
    margin-top: 80px;
    background: linear-gradient(135deg, rgba(34, 34, 34, 0.95), rgba(12, 12, 12, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: clamp(36px, 5vw, 60px);
    color: var(--text-color);
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.footer-brand {
    display: grid;
    gap: 18px;
}

.footer-logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--accent-color);
}

.footer-tagline {
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

.footer-contact-label {
    flex-basis: 100%;
    font-weight: 500;
    color: var(--text-color);
}

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

.footer-contact a:hover,
.footer-links a:hover {
    color: #7dffb8;
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(16px, 3vw, 32px);
}

.footer-heading {
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: var(--secondary-text);
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-meta {
    margin-top: clamp(28px, 4vw, 40px);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

@media (max-width: 720px) {
    .site-footer {
        margin-top: 60px;
        padding: 32px 24px;
    }

    .footer-nav {
        grid-template-columns: 1fr;
    }
}

/* Three-column layout for tools pages */
.three-col-layout {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
}

/* Table of Contents Sidebar (left) */
.toc-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 16px;
}

.toc-sidebar h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toc-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-sidebar a {
    color: var(--secondary-text);
    font-size: 0.88rem;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.toc-sidebar a:hover {
    color: var(--accent-color);
    background: rgba(0, 255, 0, 0.08);
}

.toc-sidebar a.active {
    color: var(--accent-color);
    background: rgba(0, 255, 0, 0.12);
    font-weight: 500;
}

/* Main Content Area (middle) */
.main-content {
    min-width: 0; /* Prevents grid blowout */
    padding: 48px 0 96px;
    max-width: 100%; /* Ensure content doesn't exceed grid column */
}

.main-content > h1 {
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin-bottom: 16px;
}

.main-content .page-intro {
    color: var(--secondary-text);
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* CTA Sidebar (right) */
.cta-sidebar {
    position: sticky;
    top: 20px;
}

.cta-box {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 8px 24px rgba(138, 43, 226, 0.3);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cta-box h3 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.cta-box p {
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gradient-start);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cta-button svg {
    transition: transform 0.25s ease;
}

.cta-button:hover svg {
    transform: translateX(3px);
}

/* Responsive: Collapse to single column on tablets and mobile */
@media (max-width: 1100px) {
    .three-col-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .toc-sidebar,
    .cta-sidebar {
        position: static;
        max-height: none;
    }

    .toc-sidebar {
        order: -1; /* Move TOC to top on mobile */
    }

    .cta-sidebar {
        order: 1; /* CTA comes after content */
    }

    .main-content {
        order: 0;
    }
}

/* Scrollbar styling for TOC */
.toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
