/* Base Styles */
* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Search Box Styles */
.search-container {
    display: flex;
    margin-bottom: 5px;
    padding: 0 5px;
}

.search-container input {
    flex-grow: 1;
    padding: 8px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    min-width: 0;
    /* Ensure input shrinks inside flex container */
}

.search-container button {
    padding: 8px 12px;
    background-color: #2a8a70;
    /* Darker green for contrast against sidebar */
    border: none;
    color: white;
    /* Ensure text/icon color is white */
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container button i {
    color: white;
    /* Explicitly set icon color */
}

.search-container button:hover {
    background-color: #2a8a70;
}

mark.search-highlight {
    background-color: #ffeb3b;
    color: black;
    padding: 2px 0;
    border-radius: 2px;
}

a {
    color: #009688;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Sidebar (Sticky) */
.sidebar {
    width: 290px;
    /* Matched to setup.html effective width (250+40 padding) */
    background-color: #38b494;
    /* Teal Background */
    padding: 20px;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    border-right: none;
    color: #fff;
    z-index: 1000;
}

/* Sidebar Title specific style */
.sidebar .sidebar-title {
    color: #fff;
    margin-top: 0;
    font-size: 14px;
    /* Reduced to fit long title on one line */
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.sidebar li {
    margin-bottom: 5px;
}

.sidebar li a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    /* White text */
    border-radius: 4px;
    transition: background 0.2s;
    text-decoration: none;
    font-weight: bold;
    /* Bold for main menus */
}

.sidebar li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    /* Semi-transparent white hover */
    color: #fff;
    text-decoration: none;
}

.sidebar li a.active {
    background-color: #fff;
    /* White active background */
    color: #38b494;
    /* Teal text */
    font-weight: bold;
}

/* Submenu */
.sidebar ul ul {
    margin: 5px 0 10px 10px;
    padding-left: 0;
    list-style: none;
}

.sidebar ul ul li {
    position: relative;
    padding-left: 20px;
    /* Space for the connector */
    margin-bottom: 0;
}

/* Tree Connector (L-shape) */
.sidebar ul ul li::before {
    content: "";
    position: absolute;
    top: -10px;
    /* Start from above to connect to parent/sibling */
    left: 5px;
    width: 10px;
    height: calc(50% + 10px);
    /* Height to reach middle of current item */
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.sidebar ul ul li a {
    font-size: 0.9em;
    padding: 5px 10px;
    color: rgba(255, 255, 255, 0.9);
    background: none !important;
    font-weight: normal;
    /* Normal for submenus */
}

.sidebar ul ul li a:hover {
    color: #fff;
    text-decoration: underline;
    background: none !important;
}

/* Main Content */
.main-content {
    margin-left: 290px;
    /* Sidebar width + padding */
    padding: 0;
    max-width: 900px;
    flex: 1;
}

/* Section Spacing */
section {
    scroll-margin-top: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
    padding: 60px 40px;
}

#section-1 {
    padding-top: 0;
    /* Remove top padding to rely on TOC margin */
}

/* Zebra Striping */
section:nth-of-type(even) {
    background-color: #f8f9fa;
    /* Light Gray */
}

/* Typography */
/* Typography */
h1 {
    font-size: 24px;
    background-color: #38b494;
    /* Solid Green */
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    margin-top: 0;
}

h2 {
    font-size: 20px;
    color: #2a8a70;
    background-color: #e8f5f0;
    border-left: 6px solid #34b090;
    padding: 12px 20px;
    margin-top: 40px;
    margin-bottom: 20px;
    border-radius: 4px;
}

h3 {
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-top: 30px;
}

h4 {
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0 10px;
    color: #2c3e50;
    /* Dark Slate */
}

/* Box Styles */
.instruction-box {
    background-color: #f0f0f0;
    /* Light Gray */
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
    /* Dark Text */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}



h3 {
    font-size: 16px;
    color: #38b494;
    /* Green title */
    margin-top: 30px;
    background-color: #fff;
    /* White background */
    border-left: 6px solid #38b494;
    padding: 10px 15px;
    border-radius: 4px;
}

h4 {
    background-color: transparent;
    color: #38b494;
    padding: 0 0 10px 0;
    margin: 0;
    font-weight: bold;
    font-size: 1.1em;
    border-bottom: 1px solid #f0f0f0;
    /* Subtle separator */
}

/* Utility Boxes (Solid Fill Design) */
.solid-box-green {
    background-color: #dbece0;
    /* Deepened Green */
    border-radius: 8px;
    padding: 20px;
    color: #1b5e20;
    margin: 20px 0;
}

.solid-box-red {
    background-color: #fff3cd;
    /* Deepened Yellow/Cream */
    border-radius: 8px;
    padding: 20px;
    color: #8a6d3b;
    margin: 20px 0;
}

.method-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.method-box div,
.box-flow div {
    padding: 20px;
}

.method-box h4,
.box-flow h4 {
    list-style: none;
    margin: 0 0 10px 0;
}



/* Force white background for boxes inside colored sections */
section:nth-of-type(even) .solid-box-green,
section:nth-of-type(even) .solid-box-red,
section:nth-of-type(even) .method-box,
section:nth-of-type(even) .box-flow,
section:nth-of-type(even) .box-email,
section:nth-of-type(even) .placeholder-img {
    background-color: #ffffff;
    border: 1px solid #eee;
    /* Add light border for definition */
}

/* Exception for blocks that need specific colors */


.login-url-box {
    background-color: transparent;
    color: #ff9900;
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px 0;
    text-align: left;
    margin: 20px 0;
}

.login-url-box a {
    color: #ff9900;
    text-decoration: underline;
}



.box-flow {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.box-flow h3 {
    background-color: transparent;
    color: #38b494;
    margin: 0;
    padding: 0 0 10px 0;
    /* Reduced top padding */
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    font-size: 1.1em;
    /* Removed padding-left to match h4 */
}

.box-email {
    background-color: #f8f9fa;
    /* Very Light Gray */
    border: 1px solid #d1d5db;
    /* Light Gray Border */
    padding: 20px;
    margin: 20px 0;
    color: #495057;
    font-family: monospace;
    border-radius: 4px;
}

.placeholder-img {
    background-color: #eee;
    padding: 40px;
    text-align: center;
    border: 2px dashed #ccc;
    color: #666;
    margin: 20px 0;
}

.text-red {
    color: #38b494;
    /* Green for general emphasis */
    font-weight: bold;
}

.convenience-compact .text-red {
    color: #3b82f6;
    /* Blue for convenience emphasis */
}

.convenience-compact strong {
    color: #3b82f6;
    /* Ensure bold text is also blue inside convenience box */
}

a {
    color: #38b494;
    text-decoration: underline;
}

a:hover {
    color: #2a8a70;
    /* Darker green on hover */
    text-decoration: none;
}

/* Tab simulation */
.convenience-compact {
    background-color: #dbeafe;
    /* Solid Light Blue */
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin: 20px 0;
    border: none;
}

.badge-blue {
    background-color: #3b82f6;
    /* Blue */
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    /* Pill shape */
    white-space: nowrap;
    font-size: 0.9em;
    margin-top: 2px;
}

.point-compact {
    background-color: #fff3cd;
    /* Deepened Yellow */
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
}

.badge-red {
    background-color: #8a6d3b;
    /* Brown to match caution text */
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    /* Pill shape */
    white-space: nowrap;
    font-size: 0.9em;
}

.caution-box {
    background-color: #fff3cd;
    /* Light Yellow/Cream */
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: start;
    gap: 15px;
    margin: 20px 0;
    color: #8a6d3b;
    /* Brown text */
}

.badge-green {
    background-color: #2e7d32;
    /* Green */
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    /* Pill shape */
    white-space: nowrap;
    font-size: 0.9em;
}

.point-box {
    background-color: #e8f5e9;
    /* Light Green */
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
}

/* Emphasis inside Green/Point Box */
.point-box strong,
.point-box .text-red,
.point-box b {
    color: #2e7d32;
    /* User requested Green #2e7d32 */
}

/* Reference Style (Orange) */
.badge-reference {
    background-color: #f39c12;
    /* Orange */
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 0.9em;
}

.reference-box {
    background-color: #fff3e0;
    /* Light Orange */
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: start;
    gap: 15px;
    margin: 20px 0;
}



/* Standard Image Class */
.screen-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 20px auto;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .content {
        margin-left: 240px;
        padding: 20px 30px;
    }

    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.3em;
    }
}

/* Mobile and Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        display: block;
        /* Remove flexbox to prevent flex-related overflow */
        width: 100%;
        overflow-x: hidden;
    }

    /* Guard against large images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Hide sidebar on mobile */
    .sidebar {
        display: none;
    }

    /* Full width content on mobile */
    /* Full width content on mobile */
    /* Full width content on mobile */
    .content {
        margin-left: 0;
        padding: 55px 0 0;
        /* Only top padding for header */
        width: 100%;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
        /* Remove all padding so sections touch edges */
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        /* Force hide any internal overflow */
    }

    /* Reduce section padding on mobile */
    section {
        padding: 30px 15px;
        /* Keep internal padding for text */
    }

    /* Adjust headings */
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
        padding: 12px 15px;
    }

    h3 {
        font-size: 1.1em;
        padding: 8px 12px;
    }

    h4 {
        font-size: 1em;
    }

    /* Adjust boxes */
    .method-box div,
    .box-flow div {
        padding: 15px;
    }

    .point-box,
    .caution-box,
    .convenience-compact {
        padding: 12px;
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
        /* Align badge to left */
    }

    /* Target nested flex containers inside boxes */
    .point-box>div,
    .caution-box>div,
    .convenience-compact>div {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .instruction-box {
        padding: 10px 15px;
        font-size: 0.95em;
    }

    /* Adjust images */
    .screen-image {
        max-width: 100%;
    }

    /* Adjust search box */
    .search-box {
        padding: 8px;
    }

    .search-box input {
        font-size: 14px;
    }

    /* Compact contact section even more on mobile */
    #section-contact {
        padding: 20px 0;
    }

    #section-contact h2 {
        font-size: 1.3em;
    }

    #section-contact p {
        font-size: 0.9em !important;
    }

    #section-contact img {
        max-width: 100px !important;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .content {
        padding: 10px 15px;
    }

    h2 {
        font-size: 1.2em;
        padding: 10px 12px;
    }

    h3 {
        font-size: 1em;
        padding: 8px 10px;
    }

    .method-box div,
    .box-flow div {
        padding: 12px;
    }

    .point-box,
    .caution-box,
    .convenience-compact {
        padding: 10px;
        gap: 8px;
        flex-direction: column;
    }

    /* Stack badges on top of content on very small screens */
    .badge-blue,
    .badge-green,
    .badge-orange,
    .badge-red {
        margin-bottom: 8px;
    }

    /* Adjust lists */
    ul,
    ol {
        padding-left: 15px !important;
    }

    /* Contact section */
    #section-contact {
        padding: 15px 0;
    }

    #section-contact img {
        max-width: 80px !important;
    }

    /* Allow badges to wrap on mobile */
    .badge-blue,
    .badge-green,
    .badge-red,
    .badge-reference {
        white-space: normal;
        display: inline-block;
    }
}

/* Hamburger Menu Button (Mobile Only) */
.hamburger-menu {
    display: none;
    /* Properties to fit in header */
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    box-shadow: none;
    z-index: 1100;
    /* Above header */
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Show hamburger menu on mobile */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    /* Sidebar overlay on mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 2000;
        /* Higher z-index to overlay everything */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        display: block;
        /* Important to show element so it can slide in */
        width: 250px;
    }

    .sidebar.active {
        left: 0;
    }

    /* Overlay backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        /* Above header (1000) but below hamburger (1100) */
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        /* Use width 100% instead of right: 0 */
        background-color: #38b494;
        /* Teal color same as sidebar */
        padding: 10px 15px;
        box-sizing: border-box;
        /* Ensure padding is included */
        z-index: 1000;
        height: 50px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .mobile-logo {
        max-height: 30px;
        max-width: 100%;
        height: auto;
        filter: brightness(0) invert(1);
        /* Make logo white if it's black/colored */
    }
}

/* ========================================
   Omantome Animation
   ======================================== */
.omantome-anim {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    /* Keep icons inside */
}

.floating-icon {
    position: absolute;
    color: #38b494;
    /* Teal */
    font-size: 2em;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* Individual Icon Positions & Delays (Default) */
.icon-1 {
    top: 10%;
    left: 10%;
    color: #e67e22;
    /* Suumo Orange-ish */
}

.icon-2 {
    top: 10%;
    right: 10%;
    color: #3498db;
    /* Blue */
}

.icon-3 {
    bottom: 10%;
    left: 10%;
    color: #e74c3c;
    /* Red */
}

.icon-4 {
    bottom: 10%;
    right: 10%;
    color: #2ecc71;
    /* Green */
}

/* Keyframes for Gathering */
/* Bouncing Arrows Animation */
@keyframes bounce-right {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }
}

@keyframes bounce-left {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-10px);
    }
}

.arrow-left {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    font-size: 3em;
    color: #38b494;
    animation: bounce-right 1.5s infinite ease-in-out;
}

.arrow-right {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    font-size: 3em;
    color: #38b494;
    animation: bounce-left 1.5s infinite ease-in-out;
}

/* Text Animation */
.omantome-text-anim {
    display: inline-block;
    animation: text-pulse 2s infinite ease-in-out;
    color: white;
    background-color: #38b494;
    padding: 5px 15px;
    border-radius: 50px;
}

@keyframes text-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Assign Animations with Staggered Delays */

/* ========================================
   Web Enhancements (TOC, Back-to-Top, Copy)
   ======================================== */

/* Top TOC (Accordion) */
.top-toc {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 40px 40px 40px;
    /* 40px bottom margin for spacing */
}

.top-toc summary {
    font-weight: bold;
    cursor: pointer;
    color: #38b494;
    outline: none;
}

.top-toc ul {
    margin-top: 10px;
    padding-left: 0;
    list-style: none;
    /* Remove bullets */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    /* Natural flow */
}

.top-toc li {
    width: auto;
    /* Natural width */
    font-size: 0.9em;
    /* Smaller content */
    margin-bottom: 3px;
    margin-right: 15px;
    /* Spacing between items */
    text-align: left;
}

@media (max-width: 768px) {
    .top-toc {
        display: none;
        /* Hide on mobile */
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #38b494;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: none;
    /* Hidden by default */
    z-index: 2000;
    transition: background-color 0.3s, transform 0.3s;
}



#back-to-top:hover {
    background-color: #2a8a70;
    transform: translateY(-3px);
}

/* Copy URL Button */
#copy-url-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: all 0.2s;
}

#copy-url-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

#copy-url-btn.copied {
    background-color: #38b494;
    color: white;
    border-color: #38b494;
}