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

img {
    max-width: 100%;
    height: auto;
}

:root {
    --bg-white: #ffffff;
    --text-primary: #000000;
    --sidebar-width: 18.75rem;
}

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

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-white);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: 0.75rem;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid #000;
    padding: 0.25rem 0.25rem;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.5rem;
    font-weight: 700;
    text-align: center;
}

.header-icon {
    width: 1rem;
    height: 1rem;
}

.container {
    display: flex;
    height: 100vh;
    margin-top: 0;
    margin-bottom: 0;
}

/* Sidebar Styles */
.sidebar {
    width: 100vw;
    background-color: var(--bg-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 4rem;
    bottom: 0;
    overflow: hidden;
    transform: translateX(-100%);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.mobile-open {
    transform: translateX(0);
}

.mobile-menu-btn {
    display: block;
    position: static;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.bar {
    display: block;
    width: 1.5rem;
    height: 2px;
    background-color: #000;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-btn.open .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.open .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.sidebar-header {
    padding: 0.5rem;
    position: relative;
}



.sidebar-header h1 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.search-box {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #000;
    font-size: 1rem;
    background-color: var(--bg-white);
    outline: none;
}

.categories {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.category {
    margin-bottom: 0.75rem;
}

.category-title {
    font-size: 1rem;
    margin-bottom: 0.375rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #000;
    cursor: pointer;
}

.toggle-icon {
    margin-right: 0.3125rem;
}

.chapter-list {
    padding: 0;
}

.chapter-item {
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.chapter-item:hover {
    background-color: #f0f0f0;
}

.chapter-item .tool-name {
    font-size: 0.9rem;
}

/* Content Area Styles */
.content-area {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.content-card {
    background: var(--bg-white);
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.content-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #000;
}

.content-header h2 {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.content-header .category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border: 1px solid #000;
    font-size: 0.5rem;
}

.content-body {
    padding: 0.75rem;
}

.section {
    margin-bottom: 0.75rem;
}

.section h3 {
    font-size: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #000;
}

.section p {
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.25rem 0;
    padding-left: 0.75rem;
    position: relative;
    line-height: 1.6;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: 700;
}

.step-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

.step-list li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.step-list li:before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.5rem;
}

.step-list li strong {
    display: block;
    margin-bottom: 0.25rem;
}

.content-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.print-btn:hover {
    background: #333;
}

.back-btn {
    background: #666;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}

.back-btn:hover {
    background: #999;
}

.no-tool-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.no-tool-selected h3 {
    font-size: 0.5rem;
    margin-bottom: 0.5rem;
}

.no-tool-selected .icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Mobile First Media Queries */

/* Small Mobile (384px+) */
@media (min-width: 24rem) {
    body {
        font-size: 0.875rem;
    }

    .site-header {
        padding: 0.375rem 0.5rem;
    }

    .back-link {
        font-size: 0.625rem;
        gap: 0.375rem;
    }

    .header-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .mobile-menu-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.625rem;
        top: 3.5rem;
        left: 0.375rem;
    }

    .sidebar-header {
        padding: 0.75rem;
    }

    .sidebar-header h1 {
        font-size: 0.625rem;
        margin-bottom: 0.625rem;
    }

    .search-box {
        padding: 0.375rem 0.625rem;
        font-size: 0.625rem;
    }

    .categories {
        padding: 0.375rem;
    }

    .category {
        margin-bottom: 0.875rem;
    }

    .category-title {
        font-size: 0.625rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.3125rem;
    }

    .chapter-item {
        padding: 0.375rem 0.625rem;
    }

    .chapter-item .tool-name {
        font-size: 0.625rem;
    }

    .content-wrapper {
        padding: 0.5rem;
    }

    .content-header {
        padding: 0.75rem 1rem;
    }

    .content-header h2 {
        font-size: 0.875rem;
    }

    .category-badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.625rem;
    }

    .content-body {
        padding: 1rem;
    }

    .section {
        margin-bottom: 1rem;
    }

    .section h3 {
        font-size: 0.625rem;
        margin-bottom: 0.625rem;
        padding-bottom: 0.4375rem;
    }

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

    .feature-list li {
        padding: 0.375rem 0;
        padding-left: 1rem;
    }

    .step-list li {
        padding: 0.5rem 0;
        padding-left: 1.5rem;
    }

    .step-list li:before {
        width: 1rem;
        height: 1rem;
        font-size: 0.625rem;
        top: 0.375rem;
    }

    .content-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .print-btn, .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.625rem;
    }

    .no-tool-selected h3 {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .no-tool-selected .icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
}

/* Tablet (768px+) */
@media (min-width: 48rem) {
    body {
        font-size: 1rem;
    }

    .site-header {
        padding: 0.5rem 0.75rem;
    }

    .back-link {
        font-size: 0.875rem;
        gap: 0.5rem;
    }

    .header-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    .sidebar {
        width: var(--sidebar-width);
        transform: none;
        position: fixed;
    }

    .sidebar.mobile-open {
        transform: none;
    }

    .content-area {
        margin-left: var(--sidebar-width);
    }

    .mobile-menu-btn {
        display: none;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .content-header {
        padding: 1rem 1.25rem;
    }

    .content-header h2 {
        font-size: 1rem;
    }

    .category-badge {
        padding: 0.375rem 1rem;
        font-size: 0.75rem;
    }

    .content-body {
        padding: 1.25rem;
    }

    .section h3 {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

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

    .feature-list li {
        padding: 0.5rem 0;
        padding-left: 1.25rem;
    }

    .step-list li {
        padding: 0.625rem 0;
        padding-left: 1.875rem;
        border-bottom: 1px solid #000;
    }

    .step-list li:before {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.75rem;
        top: 0.5rem;
    }

    .content-footer {
        padding: 1rem 1.5rem;
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }

    .print-btn, .back-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.75rem;
    }

    .no-tool-selected h3 {
        font-size: 1rem;
    }

    .no-tool-selected .icon {
        font-size: 2.5rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 64rem) {
    body {
        font-size: 0.875rem;
    }

    .site-header {
        justify-content: center;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .content-header {
        padding: 1.5rem 2rem;
    }

    .content-header h2 {
        font-size: 1.125rem;
    }

    .category-badge {
        font-size: 0.875rem;
    }

    .content-body {
        padding: 2rem;
    }

    .section h3 {
        font-size: 0.875rem;
    }

    .feature-list li {
        padding: 0.625rem 0;
        padding-left: 1.5rem;
    }

    .step-list li {
        padding: 0.75rem 0;
        padding-left: 2.25rem;
    }

    .step-list li:before {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.875rem;
        top: 0.625rem;
    }

    .content-footer {
        padding: 1.25rem 2rem;
    }

    .print-btn, .back-btn {
        padding: 1rem 2rem;
        font-size: 0.875rem;
    }

    .no-tool-selected h3 {
        font-size: 1.25rem;
    }

    .no-tool-selected .icon {
        font-size: 3rem;
    }
}

/* Large (1280px+) */
@media (min-width: 80rem) {
    body {
        font-size: 1rem;
    }

    :root {
        --sidebar-width: 20rem;
    }

    .content-wrapper {
        padding: 2rem;
    }

    .content-header {
        padding: 2rem 2.5rem;
    }

    .content-header h2 {
        font-size: 1.25rem;
    }

    .category-badge {
        font-size: 1rem;
    }

    .content-body {
        padding: 2.5rem;
    }

    .content-card {
        max-width: 60rem;
    }

    .section h3 {
        font-size: 1rem;
    }

    .feature-list li {
        padding: 0.75rem 0;
        padding-left: 1.75rem;
    }

    .step-list li {
        padding: 0.875rem 0;
        padding-left: 2.5rem;
    }

    .step-list li:before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
        top: 0.75rem;
    }

    .content-footer {
        padding: 1.5rem 2.5rem;
    }

    .print-btn, .back-btn {
        padding: 1.125rem 2.25rem;
        font-size: 1rem;
    }

    .no-tool-selected h3 {
        font-size: 1.5rem;
    }

    .no-tool-selected .icon {
        font-size: 3.5rem;
    }
}

/* Ultra-wide (1920px+) */
@media (min-width: 120rem) {
    body {
        font-size: 1.125rem;
    }

    :root {
        --sidebar-width: 22rem;
    }

    .content-wrapper {
        padding: 2.5rem;
    }

    .content-header {
        padding: 2.5rem 3rem;
    }

    .content-header h2 {
        font-size: 1.375rem;
    }

    .category-badge {
        font-size: 1.125rem;
    }

    .content-body {
        padding: 3rem;
    }

    .content-card {
        max-width: 70rem;
    }

    .section h3 {
        font-size: 1.125rem;
    }

    .feature-list li {
        padding: 0.875rem 0;
        padding-left: 2rem;
    }

    .step-list li {
        padding: 1rem 0;
        padding-left: 2.75rem;
    }

    .step-list li:before {
        width: 2rem;
        height: 2rem;
        font-size: 1.125rem;
        top: 0.875rem;
    }

    .content-footer {
        padding: 1.75rem 3rem;
    }

    .print-btn, .back-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.75rem;
    }

    .no-tool-selected h3 {
        font-size: 1.75rem;
    }

    .no-tool-selected .icon {
        font-size: 4rem;
    }
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 20mm 15mm 30mm 15mm;
        @bottom-left {
            content: "Page " counter(page);
            font-size: 10pt;
            color: #000;
        }
    }

    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .sidebar,
    .mobile-menu-btn,
    .content-footer,
    .back-btn,
    .print-btn,
    .site-header {
        display: none !important;
    }

    .content-area {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body {
        height: auto !important;
        overflow: visible !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    .content-wrapper {
        overflow: visible !important;
        padding: 0 !important;
    }

    .content-card {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .content-header {
        page-break-after: avoid;
    }

    .section {
        page-break-inside: avoid;
    }

    .section h3 {
        page-break-after: avoid;
    }

    .step-list li {
        page-break-inside: avoid;
    }

    .feature-list li {
        page-break-inside: avoid;
    }
}
