/* Document Content Style Overrides */
.my-div, .doc-content {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    color: #e0e0e0 !important;
    font-family: var(--font-body) !important;
    line-height: 1.6 !important;
}

.my-div p, .doc-content p,
.my-div span, .doc-content span,
.my-div li, .doc-content li,
.my-div td, .doc-content td,
.my-div th, .doc-content th {
    color: #e0e0e0 !important;
    font-family: var(--font-body) !important;
    background-color: transparent !important;
    background: transparent !important;
}

/* Headings within the document */
.my-div h1, .my-div h1 span, .doc-content h1, .doc-content h1 span,
.my-div h2, .my-div h2 span, .doc-content h2, .doc-content h2 span,
.my-div h3, .my-div h3 span, .doc-content h3, .doc-content h3 span,
.my-div h4, .my-div h4 span, .doc-content h4, .doc-content h4 span,
.my-div h5, .my-div h5 span, .doc-content h5, .doc-content h5 span,
.my-div h6, .my-div h6 span, .doc-content h6, .doc-content h6 span {
    color: var(--accent) !important;
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
}

/* Accentuate links */
.my-div a, .my-div a span, .doc-content a, .doc-content a span {
    color: var(--accent) !important;
    text-decoration: underline !important;
    transition: opacity 0.2s !important;
}

.my-div a:hover, .my-div a span:hover, .doc-content a:hover, .doc-content a span:hover {
    opacity: 0.8 !important;
}

/* Table overrides */
.my-div table {
    border-color: var(--border) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-collapse: collapse !important;
}

.my-div td, 
.my-div th {
    border-color: var(--border) !important;
    padding: 10px !important;
}

/* Divider lines inside document */
.my-div hr {
    border: none !important;
    border-top: 1px solid var(--border) !important;
    margin: 1.5rem 0 !important;
}

/* Bottom sheet sidebar styling (slides up from the bottom when active) */
.sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    width: 100% !important;
    max-width: 500px !important;
    max-height: 70vh !important;
    background: rgba(15, 15, 15, 0.95) !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    border-radius: 24px 24px 0 0 !important;
    backdrop-filter: blur(24px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--accent-glow) !important;
    transform: translate(-50%, 100%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 2000 !important;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 20px !important;
}

.sidebar.active {
    transform: translate(-50%, 0) !important;
}

.sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border);
    padding: 20px 20px 10px !important;
    margin-top: 0 !important;
    text-align: center;
    position: relative;
}

/* Pull-to-dismiss bar indicator for bottom sheet look */
.sidebar-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: none !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 5px 0 0 !important;
}

.sidebar-header p {
    font-size: 0.78rem;
    color: var(--text-muted) !important;
    text-shadow: none !important;
    margin-top: 4px !important;
}

.sidebar-nav {
    padding: 10px 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.sidebar-nav li {
    border-bottom: 1px solid var(--border) !important;
    padding: 0 !important;
}

.sidebar-nav a {
    color: #ccc !important;
    font-family: var(--font-body);
    font-size: 0.95rem !important;
    padding: 12px 24px !important;
    display: block !important;
    text-decoration: none !important;
    border-left: none !important;
    margin-left: 0 !important;
    transition: all 0.2s ease !important;
}

.sidebar-nav a:hover {
    background: rgba(255, 221, 0, 0.08) !important;
    color: var(--accent) !important;
    padding-left: 30px !important; /* nudge animation */
}

.sidebar-nav .submenu-item a {
    padding-left: 40px !important;
}

.sidebar-nav .submenu-item a:hover {
    padding-left: 46px !important;
}

.sidebar-nav span {
    color: #ccc !important;
    font-family: var(--font-body);
    font-size: 0.95rem !important;
    padding: 12px 24px !important;
    display: block !important;
}

.sidebar-nav .submenu-item span {
    padding-left: 40px !important;
}

.sidebar-nav .sub-submenu-item a {
    padding-left: 56px !important;
}

.sidebar-nav .sub-submenu-item a:hover {
    padding-left: 62px !important;
}

.sidebar-nav .sub-submenu-item span {
    padding-left: 56px !important;
}

/* Glassmorphic Back button */
.back-btn {
    position: fixed;
    top: 80px;
    left: 22px;
    z-index: 1000;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.back-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 8px 25px var(--accent-glow2);
    transform: scale(1.1) translateY(-2px);
}

/* Glassmorphic Scroll Button */
.scroll-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 1000;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
}

.scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 8px 25px var(--accent-glow2);
    transform: scale(1.1) translateY(-2px);
}

/* Hamburger menu overrides */
.hamburger-menu {
    position: fixed;
    bottom: 80px;
    right: 22px;
    z-index: 1001;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border) !important;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 !important;
}

.hamburger-menu:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 8px 25px var(--accent-glow2) !important;
    transform: scale(1.1) translateY(-2px);
}

.hamburger-menu .bar {
    width: 18px !important;
    height: 2px !important;
    background-color: #fff !important;
    border-radius: 1px;
    transition: all 0.3s ease-in-out;
}

.hamburger-menu:hover .bar {
    background-color: #000 !important;
}

/* Expand the page wrapper slightly and reduce top padding for better document visibility */
.page-wrapper {
    max-width: 900px !important;
    padding-top: 35px !important;
}

/* Centered header styling & reduced bottom space */
.blog-header {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin-bottom: 1.2rem !important;
}

.blog-header h1,
.blog-header .subtitle {
    text-align: center !important;
    width: 100% !important;
}

/* Glassmorphic wrapper padding tweak */
.glass-wrap {
    padding: 1.25rem 1.5rem !important;
}

/* Document content root margin */
.my-div {
    margin-top: 0 !important;
}

/* Right-aligned language links (.div1) with reduced padding */
.div1 {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 0 4px 8px 4px !important;
    margin: 0 0 5px 0 !important;
}

.div1 .p1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
}

/* Image styling updates for dark mode */
.my-div img {
    border: 1px solid var(--border) !important;
    border-radius: 10px;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .home-btn {
        top: auto;
        bottom: 22px;
        left: auto;
        right: 22px;
    }
    .back-btn {
        top: auto;
        bottom: 22px;
        left: 22px;
    }
    .scroll-btn {
        bottom: 80px;
        right: 22px;
    }
    .hamburger-menu {
        bottom: 138px;
        right: 22px;
    }
    .sidebar {
        right: 12px;
        bottom: 200px;
        width: calc(100% - 24px);
        max-width: 300px;
    }
}

/* Document Floating Search Button & Panel */
.dump-search-btn {
    position: fixed;
    bottom: 138px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.dump-search-btn:hover {
    background: var(--accent, #d4af37);
    color: #000;
    transform: scale(1.1) translateY(-2px);
}

.dump-search-container {
    position: fixed;
    bottom: 192px;
    right: 22px;
    width: 360px;
    max-height: 420px;
    background: rgba(15, 17, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    z-index: 2100;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dump-search-container.search-container-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(15px);
}

.dump-search-container .search-bar-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
}

.dump-search-container .search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.dump-search-container .search-input-icon {
    position: absolute;
    left: 0.75rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.dump-search-container input[type="text"] {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.dump-search-container input[type="text"]:focus {
    border-color: #d4af37;
}

.dump-search-container button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

.dump-search-container button:hover {
    color: #fff;
}

.dump-search-container .search-tags-container {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dump-search-container .search-tags-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.dump-search-container .search-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 70px;
    overflow: hidden;
}

.dump-search-container .search-tag-pill {
    padding: 0.25rem 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.dump-search-container .search-tag-pill:hover {
    background: #d4af37;
    color: #000;
}

.dump-search-container .search-results-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 250px;
}

.dump-search-result-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    transition: background 0.2s;
}

.dump-search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.dump-search-result-item mark {
    background: rgba(212, 175, 55, 0.35);
    color: #fff;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .dump-search-btn {
        bottom: 196px;
        right: 22px;
    }
    .dump-search-container {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 250px;
    }
}
