:root {
    --bg: #0a0a0c;
    --card: #15151a;
    --card-alt: #1c1c24;
    --border: #2d2d3a;
    --text: #e1e1e6;
    --text-dim: #9494a5;
    --accent: #e5d115;
    --accent-hover: #f0db4f;
    --success: #2ecc71;
    --gradient: linear-gradient(135deg, #e5d115 0%, #ff9a00 100%);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar Styles */
.navbar {
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    color: var(--accent);
}

header {
    padding: 3rem 1rem 2rem;
    background: radial-gradient(circle at top, #1e1e2d 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    text-align: left;
}

.header-logo-container {
    margin-bottom: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-text h1 {
    margin: 0;
    font-size: 2.8rem;
}

.header-text p {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.header-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed rgba(229, 209, 21, 0.4);
    transition: var(--transition);
}

.header-text a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

.header-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(229, 209, 21, 0.3));
}

/* Ad Banner Styles */
.ad-container {
    max-width: 1400px;
    margin: 0 auto 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    min-height: 110px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .ad-container {
        margin: 0 1rem 2rem;
        transform: scale(0.8);
        transform-origin: center;
    }
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    margin-top: 0.5rem;
    color: var(--text-dim);
    font-weight: 300;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0 2rem 3rem;
    max-width: 1400px;
    margin: auto;
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 15px 40px rgba(229, 209, 21, 0.1);
}

.card-header {
    padding: 1rem 1.5rem;
    background-color: var(--card-alt);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
}

.card-title i {
    color: var(--accent);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0.75rem 1.5rem;
    background-color: var(--card-alt);
    border-bottom: 1px solid var(--border);
}

.tool-btn {
    background: #252530;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.tool-btn:hover {
    background: var(--border);
    color: var(--accent);
    transform: translateY(-2px);
}

.tool-btn.wide {
    width: auto;
    padding: 0 0.8rem;
}

.editor-container {
    position: relative;
    flex-grow: 1;
}

textarea {
    width: 100%;
    height: 400px;
    background: var(--card);
    color: var(--text);
    border: none;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.preview-container {
    flex-grow: 1;
    padding: 1.5rem;
    min-height: 400px;
    overflow-y: auto;
    background: radial-gradient(circle at center, #1a1a24 0%, var(--card) 100%);
}

.preview-content {
    line-height: 1.6;
}

.output-card {
    grid-column: span 2;
}

.code-output {
    font-family: 'JetBrains Mono', monospace;
    padding: 1.5rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #72f1b8;
    /* Cyberpunk green */
    font-size: 0.9rem;
    background: #0d0d12;
}

.btn-group {
    display: flex;
    gap: 10px;
}

button.primary {
    background: var(--gradient);
    color: #000;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button.primary:hover {
    box-shadow: 0 5px 15px rgba(229, 209, 21, 0.4);
    transform: translateY(-2px);
}

button.secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

button.secondary:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.floating-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-alt);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .output-card {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.6rem;
    }

    .main-container {
        padding: 0 1rem 2rem;
    }
}

/* Parsing styling helpers */
.preview-content b {
    font-weight: 700;
}

.preview-content i {
    font-style: italic;
}

.preview-content u {
    text-decoration: underline;
}

.preview-content s {
    text-decoration: line-through;
}

.preview-content a {
    color: #58a6ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(88, 166, 255, 0.4);
    transition: 0.2s;
}

.preview-content a:hover {
    border-bottom-style: solid;
}

/* Color Picker Modal */
.cp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.cp-modal.active {
    display: flex;
}

.cp-content {
    background: #ffffff;
    color: #333;
    width: 360px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cp-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.cp-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: red;
}

.cp-circle.small {
    width: 24px;
    height: 24px;
}

.cp-current-color {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid #eee;
    border-radius: 20px;
}

.cp-values-top {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #666;
}

.cp-values-top b {
    color: #000;
    margin-left: 2px;
}

.cp-close {
    position: absolute;
    right: -5px;
    top: -5px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.cp-main-area {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: crosshair;
}

#cp-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.cp-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: transparent;
}

.cp-sliders {
    margin-bottom: 20px;
}

.cp-hue-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    outline: none;
    cursor: pointer;
}

.cp-hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cp-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cp-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fcfcfc;
}

.cp-hash {
    color: #999;
    font-weight: bold;
}

#cp-hex-input {
    border: none;
    background: none;
    outline: none;
    width: 70px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
}

.cp-copy-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

#cp-format-select {
    margin-left: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: #f5f5f5;
    outline: none;
    cursor: pointer;
}

.cp-confirm-btn {
    background: #000;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.cp-confirm-btn:hover {
    background: #222;
    transform: translateY(-2px);
}

/* Footer Styles */
.main-footer {
    margin-top: 5rem;
    padding: 3rem 2rem;
    background: var(--card-alt);
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
}

.footer-logo img {
    height: 30px;
}

.footer-content p {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--card-alt);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

@keyframes toastIn {
    from {
        transform: translateY(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Alert Modal Enhancements */
.alert-content {
    text-align: center;
    padding: 30px;
}

.alert-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.alert-content h3 {
    margin: 0 0 10px;
    font-size: 1.4rem;
}

.alert-content p {
    color: var(--text-dim);
    margin-bottom: 25px;
}

.alert-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Credits Modal Styles (Dark Theme) */
.credits-content {
    background: var(--card-alt) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

.credits-content .cp-header {
    border-bottom: 1px solid var(--border);
}

.cp-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.creator-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.credits-logo {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.creator-info h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text);
}

.creator-info h3 span {
    color: var(--accent);
}

.credits-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credit-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dim);
    transition: var(--transition);
}

.credit-link i {
    font-size: 1.5rem;
    width: 25px;
    text-align: center;
}

.credit-icon-img {
    height: 24px;
    width: auto;
}

.credit-link span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.credit-link small {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.credit-link:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent);
    color: var(--text);
}

.credit-link.yt i {
    color: #ff0000;
}

.credit-link.gh i {
    color: var(--text);
}

.credit-link.scp i {
    color: var(--accent);
}

.credits-content .cp-close {
    color: var(--text-dim);
}

.credits-content .cp-close:hover {
    color: var(--text);
}