body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    color: #1c1c1e;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 🌑 Full Layout Dark Mode */
header {
    background: #1c1c1e;
    color: white;
    padding: 25px;
    text-align: left;
    font-size: 2rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}


.dark-theme {
    background: linear-gradient(135deg, #0d0d0d, #1a1a1a);
    color: #eaeaea;
}

.dark-theme header {
    background: #121212;
    color: #ffcc70;
    box-shadow: 0 4px 12px rgba(255, 204, 112, 0.2);
}

.dark-theme .preview {
    background: linear-gradient(120deg, #212121, #2e2e2e);
    border: 4px dashed #4caf50;
}

.dark-theme .tagline {
    color: #ccc;
}

.dark-theme h2 {
    color: #f5f5f5;
}

body.light-mode .header-top {
    background: #b2ebf2;
    color: #1c1c1e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .header-glow h1 {
    color: #007acc;
    text-shadow: 1px 1px 3px rgba(0, 122, 204, 0.3);
}

body.light-mode .header-tagline {
    color: #444;
    opacity: 0.85;
}





/* 💪 Stronger Header */
.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1c1c1e;
    padding: 5px 20px 20px;
    /* reduced top padding */
    text-align: center;
    /* Deep purple line */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    color: #b2ebf2;

}

.header-glow h1 {
    font-size: 2.5rem;
    color: #00e5ff;
    /* Neon cyan */
    text-shadow: 2px 2px 6px rgba(0, 229, 255, 0.5);
    margin-bottom: 10px;
}

.header-tagline {
    color: #fefefe;
    font-size: 1.2rem;
    opacity: 0.85;
}

.mam-toggle {
    margin-top: 60px;
    text-align: center;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.designed-by {
    font-size: 1.1rem;
    color: #fdfdfd;
    font-weight: 500;
}

/* Light mode tweak */
body.light-mode .designed-by {
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 64, 129, 0.1);
}

/* Manali Mam name - Dark mode */
.manali-sen-name {
    background: none;
    color: #fdfdfd;
    /* Soft gold/yellow */
    font-weight: bold;
    font-size: 2.1rem;
    text-shadow: none;
}

/* Tagline - Dark mode*/
.tagline {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 8px;
    color: #ff4081;
    opacity: 1;
    text-shadow: 1px 1px 3px rgba(255, 64, 129, 0.2);
    letter-spacing: 0.5px;
}

/* Light Theme Header */
body.light-mode header {
    background: #b2ebf2;
    color: #1c1c1e;
}

body.light-mode .manali-sen-name {
    color: #ba68c8;
    /* playful pink */
    text-shadow: 1px 1px 4px rgba(255, 64, 129, 0.4);
}

body.light-mode .tagline {
    color: #ff4081;
    /* playful pink */
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(255, 64, 129, 0.2);
}

.title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
}

@media (max-width: 600px) {
    .header-top {
        padding: 10px 12px 16px;
    }

    .header-glow h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }

    .header-tagline {
        font-size: 1rem;
        line-height: 1.4;
    }

    .mam-toggle {
        flex-direction: column;
        gap: 6px;
        font-size: 1rem;
        margin-top: 40px;
    }

    .designed-by {
        font-size: 1rem;
        text-align: center;
        line-height: 1.3;
    }

    .manali-sen-name {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 1rem;
        padding: 0 10px;
        line-height: 1.4;
    }
}

.brand-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.brand-link:hover {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

body.light-mode .brand-link:hover {
    color: #007acc;
    text-shadow: 0 0 6px rgba(0, 122, 204, 0.4);
}

.container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 20px;
    gap: 20px;
}

.editor,
.preview {
    flex: 1 1 100%;
    min-height: 300px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.editor:hover,
.preview:hover {
    transform: scale(1.02);
}

.editor {
    border: 4px dashed #00bcd4;
    background: linear-gradient(120deg, #e0f7fa, #b2ebf2);
}

.preview {
    border: 4px dashed #8bc34a;
    background: linear-gradient(120deg, #f1f8e9, #dcedc8);
}

textarea {
    flex: 1;
    width: 100%;
    min-height: 250px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 15px;
    border: none;
    border-radius: 15px;
    resize: none;
    background: #ffffffaa;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 15px;
    background: #fff;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: height 0.4s ease, min-height 0.4s ease;
}

iframe.rainbow-flash {
    animation: rainbowFlash 0.8s ease;
}

@media (max-width: 768px) {

    .editor,
    .preview {
        min-height: 350px;
    }

    iframe,
    textarea {
        min-height: 200px;
    }

    .title-line,
    .tagline {
        text-align: center;
    }

}

@keyframes rainbowFlash {
    0% {
        box-shadow: 0 0 10px #ff0000;
        /* Red */
        transform: scale(1.01);
    }

    20% {
        box-shadow: 0 0 10px #ff9900;
        /* Orange */
    }

    40% {
        box-shadow: 0 0 10px #ffff00;
        /* Yellow */
    }

    60% {
        box-shadow: 0 0 10px #33cc33;
        /* Green */
    }

    80% {
        box-shadow: 0 0 10px #3399ff;
        /* Blue */
    }

    100% {
        box-shadow: 0 0 10px #cc33ff;
        /* Purple */
        transform: scale(1);
        /* Back to normal */
    }
}

.emoji-rain {
    position: fixed;
    top: -40px;
    font-size: 30px;
    animation: drop 2s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

@keyframes drop {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(360deg);
    }
}




h2 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #444;
}



.editor-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.editor-buttons button {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    min-width: 140px;
    margin-right: 10px;
}

.editor-buttons button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 87, 34, 0.6);
    background: linear-gradient(135deg, #ff7043, #ff5722);
    /* Lighter on hover */
}

.editor-buttons button:active {
    transform: scale(0.96);
}

/* Load Example - Cool Mint Green */
.btn-load {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    /* soft to dark green */
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Clear - Smooth Coral Pink */
.btn-clear {
    background: linear-gradient(135deg, #e91e63, #ad1457);
    /* deep pink */
    color: white;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

/* Run - Electric Blue */
.btn-run {
    background: linear-gradient(135deg, #2196f3, #0d47a1);
    /* vibrant blue */
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-toggle-theme {
    background: linear-gradient(135deg, #673ab7, #512da8);
    color: white;
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.4);
}

.btn-load:hover,
.btn-clear:hover,
.btn-run:hover {
    transform: scale(1.05);
    opacity: 0.95;
}


@media (max-width: 600px) {
    .editor-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-buttons button {
        width: 100%;
        font-size: 15px;
        padding: 14px 10px;
        margin-bottom: 8px;
    }
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-right: 5px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Smooth spin for the moon in dark mode */
.theme-switch input:checked+.slider::before {
    transform: translateX(22px) rotate(360deg);
    content: "🌙";
    background-color: #222;
    color: #ffd700;
    transition: transform 0.6s ease-in-out;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffd700;
    transition: 0.4s;
    border-radius: 34px;
}

.slider::before {
    position: absolute;
    content: "🌕";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 26px;
    font-size: 18px;
    transition: 0.4s;
}

input:checked+.slider {
    background-color: #444;
}

input:checked+.slider::before {
    transform: translateX(22px);
    content: "🌙";
    background-color: #222;
    /* Darker circle for moon */
    color: #ffd700;
    /* Optional: make the moon look golden */
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    /* Space below the header before iframe */
    flex-wrap: wrap;
    gap: 10px;
}

.preview-header h2 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1;
}

.expand-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.expand-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff7043, #e64a19);
}

.btn-expand {
    padding: 8px 16px;
    font-size: 14px;
    /* 👈 Match this with .btn-paste */
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    margin-left: auto;
}

.btn-expand:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #66bb6a, #388e3c);
    opacity: 0.95;
}

body.dark-mode .btn-expand {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #e0f7fa;
}

body.dark-mode .btn-expand:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
}


@media (max-width: 600px) {
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-expand {
        width: auto;
        margin-top: 6px;
        align-self: flex-start;
    }
}

.editor-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-paste {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7cb342, #558b2f);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    margin-top: 0;
    /* ✅ remove space pushing it down */
}

.btn-paste:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #689f38, #33691e);
}

.editor-heading h2 {
    margin: 0;
    font-size: 1.5rem;
}

body.dark-mode .btn-paste {
    background: linear-gradient(135deg, #555, #333);
    /* subtle dark gradient */
    color: #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-paste:hover {
    background: linear-gradient(135deg, #666, #444);
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .editor-heading {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .editor-heading h2 {
        font-size: 1.3rem;
        text-align: left;
        margin-bottom: 4px;
    }

    .paste-wrapper {
        display: flex;
        justify-content: flex-end;
    }

    .btn-paste {
        font-size: 13px;
        padding: 6px 14px;
        margin: 0 10px 0 0;
    }
}





.btn-toggle-editor {
    padding: 8px 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #03a9f4, #0288d1);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.btn-toggle-editor:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #29b6f6, #0277bd);
}

body.dark-mode .btn-toggle-editor {
    background: linear-gradient(135deg, #455a64, #263238);
    color: #fff;
}

body.dark-mode .btn-toggle-editor:hover {
    background: linear-gradient(135deg, #607d8b, #37474f);
}

.editor {
    min-height: 300px;
}

.editor .CodeMirror {
    min-height: 250px;
}

.editor.expanded-editor {
    min-height: 600px;
    transition: min-height 0.4s ease;
}

.editor.expanded-editor .CodeMirror {
    min-height: 500px;
}

@media (max-width: 600px) {
    .btn-toggle-editor {
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* ☀️ LIGHT THEME SYMBOL BAR */
.symbol-bar {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    padding: 10px 8px;
    border-radius: 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, #fff8e1, #ffe0b2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.symbol-bar button {
    display: inline-block;
    font-size: 16px;
    padding: 8px 12px;
    margin-right: 8px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #ffca28, #f57f17);
    color: #222;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.symbol-bar button:hover {
    transform: scale(1.08);
}

.symbol-bar button:last-child {
    margin-right: 0;
}


/* 🌑 DARK THEME SYMBOL BAR */
body.dark-mode .symbol-bar {
    background: linear-gradient(135deg, #2e2e2e, #1c1c1c);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .symbol-bar button {
    background: linear-gradient(135deg, #546e7a, #263238);
    color: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #333;
    padding: 8px 0;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    position: relative;
}

.scrolling-text {
    display: inline-block;
    padding-left: 100%;
    animation: scrollText 25s linear infinite;
}

.scrolling-text span {
    display: inline-block;
    margin-right: 80px;
    /* space between messages */
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Dark Mode Version */
body.dark-mode .code-alert-bar {
    background: linear-gradient(135deg, #2e2e2e, #1c1c1c);
    border-top: 1px solid #616161;
    border-bottom: 1px solid #616161;
}

body.dark-mode .marquee p {
    color: #ffcc80;
}


/* 📘 Learn HTML Section (Core Style) */
.learn-html-section {
    margin-top: 50px;
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.learn-html-card {
    background: linear-gradient(135deg, #4527a0, #6a1b9a);
    color: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.learn-html-card:hover {
    transform: scale(1.02);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.learn-text h2 {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #ffcc70;
    text-shadow: 1px 1px 3px rgba(255, 204, 112, 0.2);
}

.learn-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #f5f5f5;
    opacity: 0.95;
}

.learn-cta-btn {
    background: #ff4081;
    color: white;
    padding: 14px 26px;
    font-weight: bold;
    border-radius: 12px;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(255, 64, 129, 0.4);
    display: inline-block;
    animation: pulse-glow 2.5s infinite;
}

.learn-cta-btn:hover {
    background: #f50057;
    transform: translateY(-2px);
}


/* ☀️ Light Mode Refresh */
body.light-mode .learn-html-card {
    background: linear-gradient(135deg, #ffffff, #e0f7fa);
    color: #1c1c1e;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.light-mode .learn-text h2 {
    color: #007acc;
    text-shadow: 1px 1px 3px rgba(0, 122, 204, 0.1);
}

body.light-mode .learn-text p {
    color: #333;
    opacity: 0.9;
}

body.light-mode .learn-cta-btn {
    background: #007acc;
    color: white;
    box-shadow: 0 6px 16px rgba(0, 122, 204, 0.2);
}

body.light-mode .learn-cta-btn:hover {
    background: #005fa3;
}


/* 📱 Responsive Touch */
@media (max-width: 600px) {
    .learn-text h2 {
        font-size: 1.5rem;
    }

    .learn-text p {
        font-size: 1rem;
    }

    .learn-cta-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 64, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 64, 129, 0.6);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 64, 129, 0.3);
    }
}




/* bottom code for extra specificity */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


body.dark-mode {
    background: #1a1a1a;
    color: #f1f1f1;
}

body.dark-mode header,
body.dark-mode .editor,
body.dark-mode .preview {
    background: #222;
    color: #eee;
}

body.dark-mode .editor-buttons button {
    background: #444;
    color: white;
}

body,
header,
.editor,
.preview {
    transition: background-color 0.6s ease-in-out, color 0.4s ease-in-out,
        border 0.5s ease-in-out;
}