@import url('/assets/css/navbar.css');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
    background: var(--bg-primary);
    padding-top: 80px; /* offset for fixed navbar */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    opacity: 0.08;
    animation: float 20s infinite linear;
}

.shape-1 {
    top: 10%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    animation-delay: 0s;
}

.shape-2 {
    top: 70%;
    left: 80%;
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 50%;
    animation-delay: -5s;
}

.shape-3 {
    top: 20%;
    left: 60%;
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation-delay: -10s;
}

.shape-4 {
    top: 60%;
    left: 20%;
    width: 50px;
    height: 50px;
    background: var(--primary-dark);
    border-radius: 10px;
    animation-delay: -15s;
}

.shape-5 {
    top: 40%;
    left: 90%;
    width: 30px;
    height: 30px;
    background: var(--gradient-1);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -7s;
}

.shape-6 {
    top: 80%;
    left: 50%;
    width: 70px;
    height: 70px;
    background: var(--gradient-1);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -12s;
}

.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 24%, rgba(255, 193, 7, 0.02) 25%, rgba(255, 193, 7, 0.02) 26%, transparent 27%, transparent 74%, rgba(255, 193, 7, 0.02) 75%, rgba(255, 193, 7, 0.02) 76%, transparent 77%, transparent),
        linear-gradient(0deg, transparent 24%, rgba(255, 193, 7, 0.02) 25%, rgba(255, 193, 7, 0.02) 26%, transparent 27%, transparent 74%, rgba(255, 193, 7, 0.02) 75%, rgba(255, 193, 7, 0.02) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

/* Page Header */
.page-header {
    text-align: center;
    margin: 40px 0 20px 0;
    animation: fadeInUp 0.8s ease both;
}

.page-title {
    font-size: 38px;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 16px;
    color: #616161;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Module Navigation Bar */
.module-nav-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px auto;
    position: relative;
    padding: 0 10px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.module-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 8px;
    box-shadow: var(--shadow-light);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}

.module-nav::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.module-nav-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #495057;
    padding: 10px 14px;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.nav-btn-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    color: inherit;
}

.nav-btn-desc {
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    transition: color 0.3s ease;
}

.module-nav-btn:hover {
    color: var(--primary-dark);
    background: rgba(255, 193, 7, 0.1);
}

.module-nav-btn:hover .nav-btn-desc {
    color: var(--primary-dark);
}

.module-nav-btn.active {
    color: #111111 !important;
    background: var(--gradient-1);
    box-shadow: 0 6px 20px rgba(255, 143, 0, 0.3);
}

.module-nav-btn.active .nav-btn-desc {
    color: rgba(17, 17, 17, 0.85) !important;
}

/* Search Bar styling */
.search-container {
    max-width: 900px;
    margin: 0 auto 35px auto;
    position: relative;
    padding: 0 10px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid transparent;
    border-radius: 35px;
    background: var(--white);
    box-shadow: var(--shadow-light);
    outline: none;
    transition: all 0.3s ease;
    color: var(--dark-color);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
    transition: color 0.3s ease;
}

.search-input:focus + .search-icon {
    color: var(--primary-dark);
}

/* Mobile warning message */
.mobile-warning-msg {
    display: none;
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.15);
    color: #e63946;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin: -10px auto 25px auto;
    max-width: 900px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    animation: fadeInUp 0.8s ease 0.15s both;
}

@media (max-width: 768px) {
    .mobile-warning-msg {
        display: inline-flex;
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* Programs Area */
.programs-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 10px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.program-card {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-light);
    border: 2px solid transparent;
    transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.48s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.48s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.program-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.program-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.program-difficulty {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #495057;
}

.program-difficulty.Easy {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.program-difficulty.Medium {
    background: rgba(255, 193, 7, 0.1);
    color: #b58100;
}

.program-difficulty.Hard {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.program-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.program-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.program-actions {
    display: flex;
    gap: 12px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.btn-view-code {
    background: rgba(255, 193, 7, 0.1);
    color: var(--primary-dark);
}

.btn-view-code:hover {
    background: var(--gradient-1);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-view-code .arrow-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.btn-view-code.active .arrow-icon {
    transform: rotate(180deg);
}

.btn-copy-code {
    background: #f1f3f5;
    color: #495057;
}

.btn-copy-code:hover {
    background: #e9ecef;
    color: #212529;
}

.btn-copy-code.copied {
    background: #28a745;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Code container expansion animation */
.code-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 0;
}

.code-container.expanded {
    margin-top: 20px;
}

/* Code container header and layout */
.code-header {
    background: #161b22;
    border: 1px solid #30363d;
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.lang-badge {
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
}

.btn-copy-code-inline {
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-copy-code-inline:hover {
    background: #21262d;
    border-color: #8b949e;
}

.btn-copy-code-inline.copied {
    background: #238636 !important;
    border-color: #2ea043 !important;
    color: #ffffff !important;
}

.code-block-wrapper {
    position: relative;
    background: #0d1117;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border: 1px solid #30363d;
    display: flex;
    overflow: hidden;
    padding: 0;
}

.code-block-wrapper .line-numbers {
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: 16px 12px !important;
    user-select: none;
    color: #57606a;
    font-family: 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    border-right: 1px solid #30363d;
    background: #0d1117;
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 45px;
}

.code-block-wrapper .line-numbers span {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

.code-block-wrapper pre.code-block {
    flex: 1;
    font-family: 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #c9d1d9;
    margin: 0 !important;
    padding: 16px !important;
    overflow-x: auto;
    background: #0d1117 !important;
}

.code-block-wrapper pre.code-block code {
    font-family: 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: inherit;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.code-block::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #0d1117;
}

.code-block::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #8b949e;
}

/* Prism overrides for GitHub Dark style */
pre[class*="language-"] {
    background: #0d1117 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

code[class*="language-"] {
    background: transparent !important;
    color: #c9d1d9 !important;
    text-shadow: none !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #8b949e !important;
    font-style: italic !important;
}

.token.punctuation {
    color: #c9d1d9 !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #79c0ff !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #a5d6ff !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #ff7b72 !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #ff7b72 !important;
    font-weight: 500 !important;
}

.token.function,
.token.class-name {
    color: #d2a8ff !important;
}

.token.regex,
.token.important,
.token.variable {
    color: #ffa657 !important;
}

/* Program Stats Header Bar */
.program-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: #f1f3f5;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #495057;
    border: 1px solid #e9ecef;
}

.program-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Info Section (Purpose, Explanation) */
.info-section {
    margin-bottom: 16px;
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f3f5;
}

.info-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #343a40;
    margin-bottom: 8px;
    border-left: 3px solid #f59e0b;
    padding-left: 8px;
}

.program-desc, .program-explanation {
    color: #495057;
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* Output styling */
.output-wrapper {
    margin-top: 12px;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    background: #0d1117;
}

.btn-toggle-output {
    width: 100%;
    background: #161b22;
    border: none;
    border-bottom: 1px solid #30363d;
    color: #c9d1d9;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

.btn-toggle-output:hover {
    background: #21262d;
}

.output-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: #090d13;
}

.output-block {
    margin: 0;
    padding: 16px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #3fb950; /* Terminal green for outputs */
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Toast Notifications */
#niedge-toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #161b22;
    color: #c9d1d9;
    text-align: left;
    border-radius: 8px;
    border-left: 4px solid #f59e0b; /* NIEdge Accent */
    padding: 16px;
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 20px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    display: flex;
    align-items: center;
}

#niedge-toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* No Results placeholder */
.no-results {
    display: none;
    text-align: center;
    color: #777;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    margin: 20px auto;
    max-width: 900px;
}

.no-results i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.no-results h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.no-results p {
    font-size: 14px;
}

/* Back Section button */
.back-section {
    text-align: center;
    margin: 50px 0 60px 0;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-back-subject {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    background: var(--gradient-1);
    padding: 14px 32px;
    border-radius: 35px;
    font-weight: 600;
    font-size: 14.5px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-back-subject:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 143, 0, 0.45);
}

/* Back To Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-1);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 143, 0, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 143, 0, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsiveness Media Queries */
@media (max-width: 992px) {
    .page-title {
        font-size: 32px;
    }
    .module-nav-container, .search-container, .programs-grid {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    .page-title {
        font-size: 28px;
    }
    .module-nav-container {
        padding: 0;
    }
    .module-nav {
        justify-content: flex-start;
        border-radius: 20px;
        gap: 8px;
        padding: 6px;
    }
    .module-nav-btn {
        flex: none;
        padding: 10px 20px;
    }
    .program-card {
        padding: 20px;
    }
    .program-title {
        font-size: 19px;
    }
    .program-actions {
        flex-direction: column;
        gap: 8px;
    }
    .btn-action {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }
    .page-subtitle {
        font-size: 14px;
    }
    .search-input {
        padding: 14px 15px 14px 45px;
        font-size: 14px;
    }
    .search-icon {
        left: 18px;
        font-size: 16px;
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }
}

/* Responsive Module Navigation styling */
.module-select-wrapper {
    display: none;
    position: relative;
    width: 100%;
    margin-bottom: 24px;
}

.module-select-box {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--border-secondary);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    outline: none;
    transition: border-color 0.2s ease;
}

.module-select-box option {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.module-select-box:focus {
    border-color: var(--accent-primary);
}

.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

@media (max-width: 576px) {
    .module-nav {
        display: none !important;
    }
    .module-select-wrapper {
        display: block !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    /* Tablet: Scrollable chips style */
    .module-nav {
        display: flex !important;
        overflow-x: auto;
        white-space: nowrap;
        gap: 12px;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .module-nav::-webkit-scrollbar {
        height: 4px;
    }
    .module-nav::-webkit-scrollbar-thumb {
        background: #ced4da;
        border-radius: 2px;
    }
    .module-nav-btn {
        flex: 0 0 auto;
        padding: 8px 16px;
    }
    .nav-btn-desc {
        display: none;
    }
}

/* Slide-up drawer modal for mobile code view */
#drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.drawer-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90vh;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-content .code-container {
    max-height: none !important;
    overflow: visible !important;
    margin-top: 20px;
}

#drawer-backdrop.active .drawer-content {
    transform: translateY(0);
}

.drawer-drag-bar {
    width: 40px;
    height: 5px;
    background: #ced4da;
    border-radius: 3px;
    margin: 8px auto 4px auto;
    flex-shrink: 0;
}

.drawer-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    padding-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.btn-close-drawer {
    background: #f1f3f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-close-drawer:hover, .btn-close-drawer:focus {
    background: #e9ecef;
    outline: none;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Long code handling style */
.code-block-wrapper.collapsed {
    max-height: 480px; /* limits to approx 22-25 lines depending on font-size/line-height */
    overflow-y: hidden;
}

.code-block-wrapper.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(13, 17, 23, 1), rgba(13, 17, 23, 0));
    pointer-events: none;
}

.btn-toggle-fullcode {
    width: 100%;
    background: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    color: #c9d1d9;
    padding: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: background 0.2s ease;
}

.btn-toggle-fullcode:hover {
    background: #21262d;
    color: #ffffff;
}

/* Focus outlines for keyboard accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

