/* ===================================
   RESPONSIVE CSS WITH 5 BREAKPOINTS
   Mobile First: 320px → 480px → 768px → 1024px → 1280px → 1440px
   =================================== */

/* ===================================
   FONT IMPORTS & VARIABLES
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Saira:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    /* Color Variables */
    --dark-bg: #020617;
    --dark-gray: #090f20;
    --card-bg: #212536;
    --light-text: #f0f0f0;
    --light-gray: #bbb;
    --secondary-bg: #2a2a2a;
    --accent-blue: #007bff;
    --accent-blue-hover: #0056b3;
    --transition-speed: 0.3s;
    --border-radius: 5px;
    --border-color: #3b3f54;
    --color-green: #0FF000;
    --yellow: #f8c555;
    --pink: #cc99cd;
    --green: #7ec699;
    --orange: #f08d49;
    --blue: #67cdcc;
    --color-blue: #1673bd;
    --accent-cyan: #00D9FF;
    --accent-magenta: #FF0080;
    --project-heading-color: #007bff;
    --prerequisites-icon-color: #28a745;
    --prerequisites-list-icon-color: #f7df1e;
    --code-bg: #111827;
    --code-border: #2d3748;
    --code-text: #e5e7eb;
    --code-line-number-bg: #1a1a1a;
    --code-line-number-color: #888;
    --sidebar-bg: #1a1a1a;
    --sidebar-border: #333;
    --tag-python: #ffd43b;
    --tag-ml: #00BCD4;
    --tag-ai: #8A2BE2;
    --program: #f57c00;
    --tag-orange: #e34f26;
    --color-orange: #f97316;
    --tag-react: #61dafb;
    --tag-webdev: #17a2b8;
    --color-purple: #5e11e3;
    --bg-secondary: #16161D;
    --legend-bg: #222;
    --legend-border: #444;
    --dark-green: #009900;
    --terminal-prompt: #0FF000;
    --terminal-output: #f0f0f0;
    --main-bg: #212536;
    --text-color: #f0f0f0;
    --text-primary: #f0f0f0;
    --text-secondary: #ccc;
    --surface: #212536;
    --surface-hover: #2a2f44;
    --border: #3b3f54;

    /* Fluid Typography - Scales smoothly across all breakpoints */
    --font-p: clamp(14px, 1.2vw + 12px, 18px);
    --font-h1: clamp(1.5rem, 2.5vw + 1rem, 1.875rem);
    --font-h2: clamp(1.2rem, 2vw + 0.8rem, 1.55rem);
    --font-h3: clamp(1.08rem, 1.5vw + 0.7rem, 1.39rem);
    --font-h4: clamp(1.02rem, 1.2vw + 0.6rem, 1.2rem);
    --font-li: clamp(14px, 1.2vw + 12px, 18.5px);
    --font-a: clamp(14px, 1.1vw + 12px, 17px);
    --font-i: clamp(13.5px, 1vw + 11px, 16px);
    --font-table: clamp(14px, 1.1vw + 12px, 17px);
    --font-code: clamp(13.5px, 1vw + 11px, 16px);
}

/* ===================================
   BASE STYLES (Mobile First: 320px+)
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Saira", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Typography */
p {
    font-size: var(--font-p);
    font-weight: 500;
    color: #cccccc;
}

li {
    font-size: var(--font-li);
    font-weight: 500;
    color: #cccccc;
}

a {
    font-size: var(--font-a);
}

i,
pre {
    font-size: var(--font-i);
}

table {
    font-size: var(--font-table);
    font-weight: 400;
}

h1 {
    font-size: var(--font-h1);
    font-weight: 700;
    color: var(--color-blue);
}

h2 {
    font-size: var(--font-h2);
    font-weight: 600;
}

h3 {
    font-size: var(--font-h3);
    font-weight: 500;
}

h4 {
    font-size: var(--font-h4);
    font-weight: 500;
}

strong {
    color: #f0f0f0;
    font-weight: 600;
}

code {
    font-size: var(--font-code);
}

/* Container - Fluid max-width */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    background-color: var(--dark-gray);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: clamp(24px, 3vw, 32px);
    height: clamp(24px, 3vw, 32px);
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typewriter {
    font-family: "Saira", sans-serif;
    white-space: pre;
    position: relative;
    font-optical-sizing: auto;
    font-weight: 500;
    color: #f0f0f0;
    font-size: clamp(1rem, 1.5vw + 0.8rem, 1.2rem);
}

.typewriter::after {
    content: "_";
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.nav-links {
    display: flex;
    margin-right: -20px;
}

.nav-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--color-blue);
    outline: 2px solid transparent;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown > a {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 10%;
    transform: translateY(-20px);
    background-color: var(--card-bg);
    min-width: 320px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform-origin: top center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 500px;
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 14px 20px;
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(59, 63, 84, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu li:first-child a {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-menu li a:hover {
    background-color: #664d44;
    color: var(--tag-orange);
    transform: translateX(5px);
}

.dropdown-menu li a:focus {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

.fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
    margin-left: 5px;
}

.dropdown:hover .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown li a:active {
    transition: all 0.3s ease;
}

/* ===================================
   MAIN CONTENT LAYOUT
   =================================== */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    padding: 20px 10px;
    gap: 20px;
}

.left-column,
.right-column {
    padding: 0 10px;
    min-width: 0;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column img {
    width: 100%;
    height: auto;
}

/* ===================================
   CARDS & CONTENT
   =================================== */
.subtitle {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.card-main-info .intro {
    color: #f0f0f0;
}

.card,
.related-topics,
.related-tags {
    /* background-color: var(--card-bg); */
    padding: 20px;
    border-radius: 5px;
    border: 1px solid var(--color-blue);
}

.card {
    margin-top: 10px;
}

.card-header span {
    padding: 2px 10px;
    border-radius: 20px;
    background-color: var(--color-green);
    color: aliceblue;
    font-size: var(--font-p);
}

.card-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

/* Learning Objectives Card */
.learning-objectives-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.learning-objectives-card .card-header i {
    color: yellow;
}

.learning-objectives-card h2 {
    color: #f0f0f0;
    margin: 0;
}

.objective-item {
    background-color: rgba(0, 102, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: .5px solid var(--color-blue);
}

.objective-item i {
    color: var(--accent-blue);
    margin-bottom: 15px;
}

.objective-item p {
    color: #cccccc;
}

.objective-item a {
    color: #ccc;
    text-decoration: none;
}

.objective-item a:hover {
    color: var(--tag-orange);
    text-decoration: underline;
}

/* Networking Card */
.networking-card,
.module-summary {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.networking-card .card-header {
    border-bottom: 1px solid var(--color-blue);
    margin-bottom: 5px;
}

.networking-card .card-header h2 {
    color: var(--dark-green);
}

.networking-card h3 {
    color: var(--accent-blue);
    margin-top: 10px;
    font-weight: 500;
}

.networking-card .content {
    margin: 10px 0;
}

.list ol,
.list ul {
    padding-left: 1.2rem;
    min-width: 90%;
}

.networking-card .list a,
.networking-card .link {
    color: #3396D3;
    text-decoration: dotted underline;
    text-underline-offset: 5px;
    transition: color 0.3s ease;
    word-wrap: break-word;
}

.networking-card .list a:hover,
.networking-card .link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.networking-card h4 {
    font-weight: 600;
    color: #DC143C;
    margin-top: 5px;
}

.networking-card .sub {
    margin-bottom: 5px;
}

.networking-card strong.subtitle {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.networking-card ul {
    list-style: none;
}

.networking-card ul li,
ol li {
    margin-bottom: 3px;
    color: #ccc;
    position: relative;
}

.networking-card .bottom ul li {
    margin-bottom: 0;
}

.networking-card ul li::before {
    content: "\25CF";
    color: var(--color-green);
    display: inline-block;
    width: 1.2em;
    margin-left: -1em;
    margin-top: 5px;
}

.networking-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
    border: 1px solid var(--border-color);
}

.networking-card .pro-tips p {
    background-color: rgba(0, 255, 0, 0.05);
    border-left: 4px solid var(--color-green);
    padding: 10px 15px;
    margin: 20px 0;
    color: #ccc;
    border-radius: 5px;
}

/* Tables */
.networking-card .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 15px 0;
}

table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    margin-bottom: 15px;
    margin-top: 5px;
}

th,
td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
    color: #ccc;
}

td.blue {
    color: var(--accent-blue);
}

th {
    background-color: #131c2e;
    font-weight: 600;
}

/* Span Colors */
span.yellow {
    color: var(--yellow);
}

span.pink {
    color: var(--pink);
}

span.green {
    color: var(--green);
}

span.orange {
    color: var(--orange);
}

span.blue {
    color: var(--blue);
}

span.grey {
    color: #bbbbbb;
}

/* ===================================
   CODE BLOCKS
   =================================== */
pre {
    border-radius: 10px;
    color: #f0f0f0;
    font-family: "Fira Code", "Ubuntu Mono", "DejaVu Sans Mono";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    backface-visibility: hidden;
    margin-bottom: 10px;
    overflow: auto;
    margin-top: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    padding-left: 10px;
    font-weight: 400;
}

.code-block,
.explanation pre {
    background-color: #131c2e;
    color: #e5e7eb;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'monospace';
    line-height: 1.5;
    border: 1px solid var(--code-border);
    margin: 5px 0 10px 0;
    font-size: 0.87rem;
    font-weight: 500;
}

code span {
    color: #23e5bb;
    font-weight: 350;
}

:not(pre) > code.inline[class*="language-"] {
    background: transparent;
}

li pre.code {
    background-color: transparent;
    border: none;
}

.explanation pre.code {
    background-color: transparent;
    padding: 5px 0;
    margin-top: 0;
}

.code-block p {
    margin-left: 16px;
    color: #f0f0f0;
}

.code {
    background-color: #131c2e;
    padding: 3px 5px;
    border-radius: 5px;
    word-break: break-all;
}

/* Output Blocks */
div.output {
    border: 1px solid var(--code-border);
    margin: 5px 0 10px 0;
    border-radius: 5px;
    overflow-x: auto;
}

.output .output-text {
    border-top: 1px solid var(--code-border);
    background-color: rgba(0, 102, 255, 0.05);
    padding: 7px 15px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
}

.output.img .output-text {
    padding: 0;
    object-fit: cover;
}

.output .output-text img {
    display: block;
}

.output.img img {
    margin: 0;
    border: none;
}

.output.only .output-text {
    background-color: #1f2937;
}

div.output .output-heading {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    margin-left: 15px;
}

div.output.only {
    border-left: 3px solid var(--color-orange);
}

div.output.only .output-text {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

div.output.only .output-text p {
    color: white;
}

p.answer strong {
    text-decoration: underline;
}

/* Diagonal Header */
.diagonal-header {
    position: relative;
    padding: 0;
    overflow: hidden;
    height: 60px;
}

.diagonal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, transparent 49.5%, var(--border-color) 49.5%, var(--border-color) 50.5%, transparent 50.5%);
}

.diagonal-header .top-right {
    position: absolute;
    top: 5px;
    right: 15px;
    font-size: 12px;
    font-weight: bold;
}

.diagonal-header .bottom-left {
    position: absolute;
    bottom: 5px;
    left: 15px;
    font-size: 12px;
    font-weight: bold;
}

div.tips {
    border-left: 3px solid var(--color-green);
    background-color: #131c2e;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

#conclusion table td code {
    color: var(--color-orange);
}

/* ===================================
   NEXT SECTION
   =================================== */
.next {
    border: 1px solid var(--accent-blue);
    padding-top: 10px;
    border-left: 5px solid var(--accent-blue);
    border-radius: 5px;
    background-color: rgba(0, 102, 255, 0.05);
    position: relative;
    margin-bottom: 20px;
    padding-left: 15px;
}

.next .header h3 {
    color: var(--accent-blue);
    margin: 0;
}

.next .header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.next .header p {
    background-color: var(--accent-blue);
    padding-left: 10px;
    padding-right: 40px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.next .content {
    padding-bottom: 40px;
}

.next .content .next-button {
    position: absolute;
    right: 30px;
    bottom: 10px;
    color: #DC143C;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.next .content .next-button::after {
    content: '➜';
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.3s ease, margin-left 0.3s ease;
}

.next .content .next-button:hover {
    color: #ff0033;
}

.next .content .next-button:hover::after {
    transform: translateX(2px);
    margin-left: 8px;
}

/* ===================================
   RAINBOW TEXT ANIMATION
   =================================== */
.rainbow-text {
    font-weight: bold;
    background: linear-gradient(45deg,
        #ff0000,
        #ff8000,
        #ffff00,
        #80ff00,
        #00ff00,
        #00ff80,
        #00ffff,
        #0080ff,
        #0000ff,
        #8000ff,
        #ff00ff,
        #ff0080);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowShift 3s ease-in-out infinite;
    text-shadow: 10px 10px 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes rainbowShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===================================
   SIDEBAR & TOPICS
   =================================== */
.about-website h3,
.ad-block h3,
.related-topics h3,
.related-tags h3 {
    color: var(--terminal-output);
    margin-bottom: 15px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
    text-align: center;
}

.about-website h3::after,
.ad-block h3::after,
.related-tags h3::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: var(--accent-blue);
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 2px;
}

.about-website p {
    color: #ccc;
    text-align: left;
    padding: 10px 0;
}

.ad-block.large,
.ad-block.medium,
.ad-block.small {
    border: 2px dashed var(--legend-border);
    width: 100%;
    height: 300px;
    background-color: var(--dark-gray);
    margin: 20px 0;
}

.ad-block.medium {
    height: 250px;
}

.ad-block.small {
    height: 100px;
}

.ad-block img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Open-source tools section */
.related-topics ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.related-topics ul li {
    border-bottom: 1px solid var(--legend-border);
    padding: 10px 0;
}

.related-topics ul li:last-child {
    border-bottom: none;
}

.related-topics .content li {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    gap: 10px;
}

.related-topics p {
    text-decoration-color: var(--color-blue);
    text-decoration: underline;
    text-underline-offset: 5px;
}

.related-topics li a {
    color: var(--light-text);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
    text-align: left;
}

.related-topics li:last-child {
    margin-bottom: 0;
}

.related-topics li i {
    background: rgba(48, 100, 174, 0.509);
    border-radius: 6px;
    padding: 10px;
    transition: padding-left 0.5s ease;
}

.related-topics li:hover {
    padding-left: 8px;
}

.related-topics li:hover i {
    background: var(--color-blue);
    color: whitesmoke;
    box-shadow: 0 0 15px rgba(58, 159, 237, 0.5);
}

/* Button Styling */
.button-container {
    margin-top: 35px;
    display: flex;
    justify-content: center;
}

.btn-cyber {
    position: relative;
    background: transparent;
    border: none;
    padding: 12px 30px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
}

.btn-bg {
    position: absolute;
    inset: 0;
    background: var(--color-blue);
    transform: translate(-6px, -6px);
    border-radius: 4px;
    z-index: 1;
    transition: transform 0.2s ease;
}

.btn-border {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    z-index: 2;
}

.btn-text {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-topics .button-container .btn-cyber a {
    color: whitesmoke;
    text-decoration: none;
}

.btn-cyber:hover .btn-bg {
    transform: translate(0, 0);
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.related-tags .tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.related-tags .tag {
    color: var(--light-text);
    padding: 8px 15px;
    font-weight: 400;
    transition: background-color var(--transition-speed) ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
}

.related-tags ol {
    padding-left: 20px;
}

.related-tags a {
    text-decoration: none;
}

.related-tags a:hover .tag {
    color: var(--tag-orange);
}

.ad-banner-in-content {
    border: 2px dashed var(--legend-border);
    width: 100%;
    height: 150px;
    background-color: var(--dark-gray);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===================================
   MOVING BORDER & ANIMATIONS
   =================================== */
@property --glow-deg {
    syntax: "<angle>";
    inherits: true;
    initial-value: -90deg;
}

@property --clr-1 {
    syntax: "<color>";
    inherits: true;
    initial-value: #4285f4;
}

@property --clr-2 {
    syntax: "<color>";
    inherits: true;
    initial-value: #ea4335;
}

@property --clr-3 {
    syntax: "<color>";
    inherits: true;
    initial-value: #fbbc05;
}

@property --clr-4 {
    syntax: "<color>";
    inherits: true;
    initial-value: #34a853;
}

.about-website.moving-border {
    --gradient-glow: var(--clr-1), var(--clr-2), var(--clr-3), var(--clr-4), var(--clr-1);
    position: relative;
    padding: 20px;
    background: #1f1f1f;
    border: 3px solid transparent;
    border-radius: 15px;
    background:
        linear-gradient(#1f1f1f 0 0) padding-box,
        conic-gradient(from var(--glow-deg), var(--gradient-glow)) border-box;
    font-weight: 500;
    color: #e8eaed;
    cursor: pointer;
    isolation: isolate;
    transition: all 0.3s ease;
    animation: breathe-glow 3s ease-in-out infinite;
}

@keyframes breathe-glow {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
}

.moving-border {
    position: relative;
    cursor: pointer;
    padding: 20px;
    background: #1f1f1f;
    border-radius: 28px;
    border: 3px solid var(--prerequisites-icon-color);
    transition: all 0.3s ease;
}

/* ===================================
   WALLPAPER & COLOR PALETTE
   =================================== */
.wallpaper,
.color-palette {
    border: 1px solid var(--color-blue);
    padding: 10px;
    border-radius: 5px;
}

.wallpaper h3,
.color-palette h3,
.related-topics h3 {
    color: var(--terminal-output);
    text-align: center;
    background: var(--color-blue);
}

.wallpaper p,
.color-palette p,
.related-topics p {
    color: #ccc;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 10px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 20px;
}

.image-card img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.image-card img:hover {
    transform: scale(1.02);
    border: 1px solid var(--color-blue);
}

.button {
    text-align: center;
    margin-bottom: 10px;
}

.button .wallpaper-button,
.button .color-button {
    margin-top: 15px;
    border: 1px dashed var(--color-blue);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    font-size: clamp(0.75rem, 1vw + 0.6rem, 1rem);
}

.button .wallpaper-button:hover,
.button .color-button:hover {
    background-color: var(--color-blue);
}

/* Palette Grid */
.palette-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.palette-card {
    background: var(--bg-secondary);
    border: 1px solid var(--sidebar-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.palette-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    border-radius: 20px;
    opacity: 0;
    transition: var(--transition-speed);
    z-index: -1;
}

.palette-card:hover::before {
    opacity: 0.5;
}

.palette-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Color Wave */
.color-wave {
    height: 180px;
    display: flex;
    position: relative;
    overflow: hidden;
}

.wave-bar {
    flex: 1;
    position: relative;
    transition: var(--transition-speed);
    cursor: pointer;
}

.wave-bar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Wave Patterns - 4 Colors */
.color-wave.colors-4 .wave-bar:nth-child(1),
.color-wave.colors-4 .wave-bar:nth-child(4) {
    transform: translateY(-10px);
}

.color-wave.colors-4 .wave-bar:nth-child(2),
.color-wave.colors-4 .wave-bar:nth-child(3) {
    transform: translateY(-35px);
}

.palette-card:hover .color-wave.colors-4 .wave-bar:nth-child(1),
.palette-card:hover .color-wave.colors-4 .wave-bar:nth-child(4) {
    transform: translateY(-20px);
}

.palette-card:hover .color-wave.colors-4 .wave-bar:nth-child(2),
.palette-card:hover .color-wave.colors-4 .wave-bar:nth-child(3) {
    transform: translateY(-45px);
}

/* Wave Patterns - 5 Colors */
.color-wave.colors-5 .wave-bar:nth-child(1),
.color-wave.colors-5 .wave-bar:nth-child(5) {
    transform: translateY(0);
}

.color-wave.colors-5 .wave-bar:nth-child(2),
.color-wave.colors-5 .wave-bar:nth-child(4) {
    transform: translateY(-20px);
}

.color-wave.colors-5 .wave-bar:nth-child(3) {
    transform: translateY(-40px);
}

.palette-card:hover .color-wave.colors-5 .wave-bar:nth-child(1),
.palette-card:hover .color-wave.colors-5 .wave-bar:nth-child(5) {
    transform: translateY(-10px);
}

.palette-card:hover .color-wave.colors-5 .wave-bar:nth-child(2),
.palette-card:hover .color-wave.colors-5 .wave-bar:nth-child(4) {
    transform: translateY(-30px);
}

.palette-card:hover .color-wave.colors-5 .wave-bar:nth-child(3) {
    transform: translateY(-50px);
}

/* Color Code Tooltip */
.wave-bar::after {
    content: attr(data-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Source Code Pro', monospace;
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.9);
    padding: 5px 9px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.wave-bar:hover::after {
    opacity: 1;
}

/* Card Info */
.card-info {
    padding: 24px;
    color: var(--terminal-output);
}

.card-title {
    font-size: var(--font-p);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.card-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-btn {
    flex: 1;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: var(--font-i);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition-speed);
}

.card-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

/* ===================================
   SCROLL UP BUTTON
   =================================== */
#scrollUpBtn {
    position: fixed;
    bottom: 36px;
    right: 10px;
    background: none;
    border: none;
    padding: 0;
    width: clamp(40px, 5vw, 53px);
    height: clamp(40px, 5vw, 53px);
    z-index: 999;
    display: none;
    cursor: pointer;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    shape-rendering: geometricPrecision;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.progress-circle .bg1 {
    fill: #000000;
    stroke: #eee;
    stroke-width: 1;
}

.progress-circle .progress {
    fill: none;
    stroke: #007bff;
    stroke-width: 1;
    stroke-dasharray: 100, 100;
    stroke-linecap: round;
    transition: stroke-dasharray 0.25s linear;
}

svg {
    image-rendering: optimizeQuality;
    text-rendering: geometricPrecision;
}

.arrow-overlay {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    font-family: Arial, Helvetica, sans-serif;
    color: #e5e7eb;
    pointer-events: none;
    cursor: pointer;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    position: relative;
    width: 100%;
    background: var(--dark-bg);
    min-height: 100px;
    padding: 20px 50px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue) 50%, transparent 50%);
    background-size: 20px 2px;
    animation: slidingBorder 1s linear infinite;
}

@keyframes slidingBorder {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

.menu {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    list-style: none;
}

.menu-link {
    font-size: var(--font-p);
    color: #fff;
    margin: 0 10px;
    display: inline-block;
    transition: 0.5s;
    text-decoration: none;
    opacity: 0.75;
    font-weight: 300;
}

.menu-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer p {
    color: #ffffff;
    margin: 15px 0 10px 0;
    font-size: var(--font-p);
    text-align: center;
}

/* ===================================
   AD CONTAINER STYLING
   =================================== */
.ad-container {
    margin: 30px auto;
    padding: 20px;
    text-align: center;
    background-color: var(--dark-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    clear: both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ad-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    font-family: 'Saira', Arial, sans-serif;
}

.ad-header {
    margin: 20px auto 30px;
    max-width: 970px;
}

.ad-in-content {
    margin: 40px auto;
    max-width: 728px;
}

.ad-footer {
    margin: 30px auto 20px;
    max-width: 728px;
}

.sidebar-ad-container {
    top: 80px;
    margin: 20px auto;
    width: 300px;
    padding: 15px;
    background-color: var(--dark-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-sticky-ad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--dark-gray) 0%, var(--dark-gray) 95%, rgba(9, 15, 32, 0.95) 100%);
    padding: 10px 0;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    border-top: 2px solid var(--color-blue);
}

.ad-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(220, 20, 60, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ad-close-btn:hover {
    background: #DC143C;
    transform: scale(1.1) rotate(90deg);
}

/* ===================================
   BREAKPOINT 1: 480px (Large Mobile)
   =================================== */
@media (min-width: 480px) {
    .container {
        max-width: 480px;
        padding: 0 1.25rem;
    }

    .image-grid {
        gap: 18px;
    }

    .ad-container {
        margin: 25px auto;
        padding: 18px;
    }

    #scrollUpBtn {
        bottom: 42px;
        right: 16px;
    }
}

/* ===================================
   BREAKPOINT 2: 768px (Tablet) - MOST IMPORTANT
   =================================== */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 0 1.5rem;
    }

    .main-content-wrapper {
        padding: 30px 20px;
        gap: 25px;
    }

    .left-column,
    .right-column {
        padding: 0;
    }

    .logo img {
        width: 27px;
        height: 27px;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .ad-container {
        margin: 28px auto;
        padding: 20px;
    }

    .ad-header {
        max-width: 728px;
        margin: 20px auto 28px;
    }

    .ad-in-content {
        max-width: 728px;
        margin: 38px auto;
    }

    .ad-footer {
        max-width: 728px;
        margin: 28px auto 20px;
    }

    .sidebar-ad-container {
        position: relative;
        float: none;
        margin: 25px auto;
        width: 100%;
        max-width: 468px;
        padding: 15px;
        top: auto;
    }

    .mobile-sticky-ad {
        display: block;
    }

    body {
        padding-bottom: 90px;
    }

    #scrollUpBtn {
        width: 45px;
        height: 45px;
        bottom: 65px;
        right: 24px;
    }
}

/* ===================================
   BREAKPOINT 3: 1024px (Desktop) - MOST IMPORTANT
   =================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding: 0 2rem;
    }

    .main-content-wrapper {
        display: grid;
        grid-template-columns: 70% 30%;
        gap: 0px;
        padding: 40px 20px;
    }

    .left-column {
        padding-right: 20px;
    }

    .right-column {
        padding: 0;
        margin-right: 0;
    }

    .logo img {
        width: 29px;
        height: 29px;
    }

    .ad-container {
        margin: 30px auto;
        padding: 22px;
    }

    .ad-header {
        max-width: 728px;
        margin: 22px auto 30px;
    }

    .ad-in-content {
        max-width: 728px;
        margin: 40px auto;
    }

    .ad-footer {
        max-width: 728px;
        margin: 30px auto 22px;
    }

    .sidebar-ad-container {
        float: right;
        display: block;
        position: relative;
        top: 0;
        width: 280px;
        /* margin: 20px 0 20px 20px; */
        padding: 15px;
    }

    .mobile-sticky-ad {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }

    #scrollUpBtn {
        width: 50px;
        height: 50px;
        bottom: 65px;
        right: 28px;
    }
}

/* ===================================
   BREAKPOINT 4: 1280px (Large Desktop)
   =================================== */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }

    .logo img {
        width: 31px;
        height: 31px;
    }

    .menu {
        flex-direction: row;
    }

    .ad-container {
        margin: 32px auto;
        padding: 24px;
    }

    .ad-header {
        max-width: 970px;
        margin: 24px auto 32px;
    }

    .ad-in-content {
        max-width: 728px;
        margin: 42px auto;
    }

    .ad-footer {
        max-width: 728px;
        margin: 32px auto 24px;
    }

    .sidebar-ad-container {
        width: 300px;
        /* margin: 20px 0 20px 25px; */
        padding: 18px;
    }

    #scrollUpBtn {
        width: 52px;
        height: 52px;
        bottom: 70px;
        right: 30px;
    }
}

/* ===================================
   BREAKPOINT 5: 1440px (Extra Large)
   =================================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1440px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .ad-container {
        margin: 35px auto;
        padding: 25px;
    }

    .ad-header {
        max-width: 970px;
        margin: 25px auto 35px;
    }

    .ad-in-content {
        max-width: 728px;
        margin: 45px auto;
    }

    .ad-footer {
        max-width: 728px;
        margin: 35px auto 25px;
    }

    .sidebar-ad-container {
        width: 300px;
        /* margin: 20px 0 20px 30px; */
        padding: 20px;
    }

    #scrollUpBtn {
        width: 53px;
        height: 53px;
        bottom: 75px;
        right: 32px;
    }
}

/* ===================================
   RESPONSIVE AD SIZING
   =================================== */
@media (max-width: 767px) {
    .ad-container ins.adsbygoogle {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .ad-container,
    .ad-header,
    .ad-in-content,
    .ad-footer,
    .sidebar-ad-container,
    .mobile-sticky-ad {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */
@media (prefers-reduced-motion: reduce) {
    .ad-close-btn {
        transition: none;
    }

    .sidebar-ad-container {
        position: relative;
        top: auto;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .ad-container {
        border: 2px solid #fff;
    }

    .ad-label {
        color: #fff;
    }

    .ad-close-btn {
        background: #000;
        border: 2px solid #fff;
    }
}
