body { 
        font-family: "Lato", sans-serif; margin: 0; 
        background-color: var(--main-bg); color: var(--main-text);
    }
    
	/* ADD THIS - Offset for sticky navbar when jumping to anchors */
	html {
		scroll-padding-top: 60px; /* Adjust this value to match your sticky navbar height + spacing */
	}
	
    /* Language-specific text styling */
    .pali-text { color: var(--pali-text); }
    .english-text { color: var(--english-text); }
    .chinese-text { color: var(--chinese-text); }

    /* Table column styling for 4 columns */
    .pali-col { 
        color: var(--pali-text, #8B4513); 
        font-style: italic;
    }
    .eng-col { 
        color: var(--english-text, #000080); 
    }
    .markup-col {
        color: var(--markup-text, #666);
        font-family: monospace;
        font-size: 0.9em;
    }
    .chinese-col { 
        color: var(--chinese-text, #8B0000); 
        font-family: "Microsoft YaHei", "SimSun", serif;
    }

    /* Language visibility controls for 4 columns */
    body.hide-english .english-text, body.hide-english .eng-col { display: none; }
    body.hide-pali .pali-text, body.hide-pali .pali-col { display: none; }
    body.hide-markup .markup-col { display: none; }
    body.hide-chinese .chinese-text, body.hide-chinese .chinese-col { display: none; }

    /* Table styling - clean borderless design */
    table { 
        border-collapse: collapse; 
        width: 100%; 
        margin: 20px 0;
    }
    
    td, th { 
        border: none; /* Remove ugly borders */
        text-align: left; 
        padding: 4px 8px; /* Reduced padding - 4px vertical, 8px horizontal */
        vertical-align: top;
    }
    
    th {
        background-color: var(--header-bg, #e8e8e8);
        font-weight: bold;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Row styling - 4px spacing between rows */
    tr {
        margin-bottom: 4px; /* Space between rows */
    }
    
    tr:hover {
        background-color: var(--hover-bg, rgba(0,0,0,0.05));
    }
    
    /* Remove alternating row colors since no borders - cleaner look */
    /* tr:nth-child(even) {
        background-color: var(--alt-row-bg, rgba(0,0,0,0.02));
    } */

    div.sticky { 
        position: -webkit-sticky; position: sticky; top: 0; 
        background-color: var(--header-bg); color: var(--header-text);
        padding: 2px 8px; font-size: 18px; z-index: 999; 
        transition: margin-left .3s; /* Add transition for smooth movement */
        backdrop-filter: blur(8px); /* Modern blur effect behind the bar */
        background: rgba(255, 255, 255, 0.85); /* 85% opacity white background */
        border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Subtle border */
    }
    
    /* Dark theme support for sticky nav */
    [data-theme*="dark"] div.sticky,
    [data-theme="tokyo-storm"] div.sticky,
    [data-theme="catppuccin-mocha"] div.sticky {
        background: rgba(30, 30, 30, 0.85); /* 85% opacity dark background */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .sidebar { 
        height: 100%; width: 0; position: fixed; z-index: 1001; top: 0; left: 0; 
        background-color: var(--sidebar-bg); color: var(--sidebar-text);
        overflow-y: auto; transition: 0.3s; padding-top: 0; 
    }
    .sidebar-nav { 
        position: -webkit-sticky; position: sticky; top: 0; 
        background-color: #333; 
        padding: 8px 10px; box-sizing: border-box; text-align: right; z-index: 10; 
    }
    .sidebar-nav-btn, .settings-btn { 
        background: var(--button-bg); border: 1px solid var(--button-border); color: var(--button-text); 
        font-size: 1.1em; cursor: pointer; margin-left: 8px; vertical-align: middle;
    }
    .openbtn { font-size: 20px; cursor: pointer; background-color: var(--sidebar-bg); color: var(--sidebar-text); padding: 10px 15px; border: none; }
    .openbtn:hover { background-color: var(--button-bg); }
    a { color: var(--link-color); text-decoration: none; }
    a:hover { color: var(--link-hover); text-decoration: underline; }
    a:visited { color: var(--link-visited); }
    #main { transition: margin-left .3s; padding: 16px; }
    
    /* FIXED COLLAPSIBLE HEADER STYLING */
    .collapsible-header, .samyutta-header, .sutta-group-header { 
        padding-top: 2.0px; padding-bottom: 2.0px; padding-right: 8px;
        text-decoration: none; display: block; cursor: pointer; text-align: left; 
        background-color: var(--sidebar-bg); color: var(--sidebar-text);
        border: none; width: 100%; 
        position: relative; /* ADDED for arrow positioning */
        transition: background-color 0.3s; /* ADDED for smooth hover */
    }
    .collapsible-header { font-size: 20px; font-weight: bold; color: #f1f1f1; padding-left: 32px; }
    .samyutta-header { font-size: 18px; color: #ccc; padding-left: 40px; }
    .sutta-group-header { font-size: 16px; color: #a0a0a0; padding-left: 48px; }
    
    /* FIXED HOVER AND ACTIVE STATES */
    .collapsible-header:hover,
    .collapsible-header.active {
        background-color: #555; /* Darker on hover/active */
    }
    
    /* FIXED ARROW INDICATORS */
    .collapsible-header::after {
        content: "▶"; /* Right arrow */
        position: absolute;
        right: 16px;
        transition: transform 0.3s;
        font-size: 14px;
        font-weight: bold;
    }
    
    .collapsible-header.active::after {
        transform: rotate(90deg); /* Down arrow when active */
    }
    
    .sutta-list a { 
        display: block; padding-top: 2.0px; padding-bottom: 2.0px;
        padding-right: 8px; padding-left: 56px;
        color: #ddd; text-decoration: none; font-size: 15px; 
    }
    .sutta-list a:hover { background-color: #333; }
    
    /* FIXED COLLAPSIBLE CONTENT */
    .collapsible-content, .samyutta-content { 
        display: none; 
        background-color: var(--sidebar-bg); 
        overflow: visible; 
    }
    
    /* ACTIVE STATE FOR CONTENT */
    .collapsible-content.active {
        display: block;
    }
    
    /* SUTTA LIST SHOULD ALWAYS BE VISIBLE WHEN PARENT IS ACTIVE */
    .sutta-list {
        display: block; /* Always visible when parent .collapsible-content is shown */
        background-color: var(--sidebar-bg); 
        overflow: visible;
        padding: 0;
    }
    
    .menu-container { position: relative; display: inline-block; vertical-align: middle; }
    .menu-button { font-size: 1em; cursor: pointer; background-color: transparent; border: none; padding: 0 10px; vertical-align: middle; }
    .menu-button:hover { background-color: #ddd; }
    .menu-content { 
        display: none; position: absolute; right: 0; 
        background-color: #f9f9f9; min-width: 180px; 
        max-height: 70vh; overflow-y: auto;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 
        z-index: 1002; border-radius: 4px;
        scrollbar-width: thin;
    }
    .menu-content.show { display: block; }
    .menu-content a, .menu-content .theme-item { color: black; padding: 12px 16px; text-decoration: none; display: block; cursor: pointer; }
    .menu-content a:hover, .menu-content .theme-item:hover { background-color: #f1f1f1; }


/* Submenu styling */
.submenu-content {
    background-color: var(--sidebar-bg, #f9f9f9);
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 4px 0;
    max-height: 300px;
    overflow-y: auto;
}

.submenu-content .theme-item {
    padding: 8px 16px;
    cursor: pointer;
    display: block;
}

.submenu-content .theme-item:hover {
    background-color: #f1f1f1;
}



/* ==========   CLICKABLE THUMBNAIL LINK STYLES  ============================================ */


/* Base link item container */
.link-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}



.link-item:hover {
    background: rgba(0, 0, 0, 0.03);
}
/* Title is NEVER a link */
.link-title {
    cursor: default;
    text-decoration: none;
    color: var(--main-text);
}

/* Kill ALL hover/link inheritance */
.link-item:hover .link-title,
.link-title:hover {
    text-decoration: none !important;
    color: var(--main-text) !important;
}

.thumb-wrapper {
    cursor: pointer;
}




/* Dark theme hover */
[data-theme*="dark"] .link-item:hover,
[data-theme="tokyo-storm"] .link-item:hover,
[data-theme="catppuccin-mocha"] .link-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Thumbnail wrapper - Style 1: Corner Arrow (DEFAULT) */
.thumb-wrapper {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.thumb-wrapper img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    transition: opacity 0.2s ease;
}

.thumb-wrapper:hover img {
    opacity: 0.8;
}



.thumb-wrapper::after {
    content: '↗';
    position: absolute;
    bottom: 4%;
    right: 4%;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    width: 25%;
    height: 25%;
    max-width: 24px;
    max-height: 24px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(9px, 2.5vw, 14px);
    font-weight: bold;
}

/* Link content area */
.link-content {
    flex: 1;
    min-width: 0; /* Prevents text overflow issues */
}

.link-title {
    font-weight: 600;
    color: var(--link-color); /* Uses your existing link color */
    margin-bottom: 5px;
    font-size: 16px;
}

.link-item:hover .link-title {
    text-decoration: underline;
    color: var(--link-hover); /* Uses your existing hover color */
}

.link-desc {
    color: var(--main-text); /* Uses theme text color */
    opacity: 0.7; /* Makes it slightly dimmer */
    font-size: 14px;
    line-height: 1.4;
}

.code-label {
    display: inline-block;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: monospace;
    color: var(--main-text);
    margin-bottom: 5px;
}

/* Dark theme adjustments */
[data-theme*="dark"] .code-label,
[data-theme="tokyo-storm"] .code-label,
[data-theme="catppuccin-mocha"] .code-label {
    background: rgba(255, 255, 255, 0.1);
}

/* Alternative Style 2: Border hover (add .style-2 class to use) */
.link-item.style-2 .thumb-wrapper img {
    border: 2px solid var(--button-border, #ddd);
    transition: border-color 0.2s ease;
}

.link-item.style-2:hover {
    background: rgba(0, 123, 255, 0.05);
    transform: translateX(5px);
}

.link-item.style-2:hover .thumb-wrapper img {
    border-color: var(--link-color);
}

/* Alternative Style 3: Badge (add .style-3 class to use) */
.link-item.style-3 .thumb-wrapper::before {
    content: 'VIEW';
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--link-color);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.link-item.style-3 .thumb-wrapper::after {
    display: none; /* Hide arrow when using badge */
}

/* =====  NEW: Arrow Corner Card Style (from clickable2.html) ===== */
/* This is a CARD-BASED layout, different from the horizontal .link-item style */

.arrow-card {
    background: var(--main-bg, white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.arrow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.arrow-card h3 {
    padding: 12px 15px;
    background: var(--header-bg, #333);
    color: var(--header-text, white);
    font-size: 14px;
    text-align: center;
    margin: 0;
}

.arrow-image-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.arrow-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.arrow-image-wrapper:hover img {
    transform: scale(1.05);
}


/* Arrow indicator for card style - scales with card size */
.arrow-image-wrapper::after {
    content: '↗';
    position: absolute;
    bottom: 6%;
    right: 6%;
    background: rgba(0,0,0,0.7);
    color: white;
    width: 18%;
    height: 18%;
    max-width: 36px;
    max-height: 36px;
    min-width: 16px;
    min-height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(10px, 3vw, 18px);
    font-weight: bold;
}


/* Dark theme for arrow cards */
[data-theme*="dark"] .arrow-card,
[data-theme="tokyo-storm"] .arrow-card,
[data-theme="catppuccin-mocha"] .arrow-card {
    background: var(--sidebar-bg, #2a2a2a);
}

[data-theme*="dark"] .arrow-image-wrapper::after,
[data-theme="tokyo-storm"] .arrow-image-wrapper::after,
[data-theme="catppuccin-mocha"] .arrow-image-wrapper::after {
    background: rgba(255,255,255,0.85);
    color: #333;
}

.arrow-card-description {
    padding: 15px;
    font-size: 13px;
    color: var(--main-text);
    opacity: 0.8;
    line-height: 1.5;
}

/* Optional: Grid layout for arrow cards */
.arrow-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 20px 0;
}

/* ==========   END CLICKABLE THUMBNAIL LINK STYLES  ============================================ */
