/* Reset default margin and padding for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Set the background image */
body {
    font-family: 'Times New Roman', serif;
    background: url('/static/img/bc3.jpeg') no-repeat center center fixed;
    background-size: cover;
    /* Ensures the background image covers the entire screen */
    height: 100vh;
    /* Full viewport height */
    overflow-x: hidden;
    /* Allow vertical scrolling when needed */
    position: relative;
    padding-bottom: 60px;
    /* padding to make room for footer */
    display: flex;
    flex-direction: column;
}

/* Class to hide the background */
body.no-background {
    background: none;
    /* Removes the background image */
    background-color: #f5f5f5;
    /* Light gray */
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

.department-banner {
    text-align: center;
    padding: 6px;
    background-color: #F5DEB3;
    color: #8B4513;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

/* Header section with logos and title */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: linear-gradient(to right, #8B4513, #654321);
    /* Brown gradient */
    color: white;
    width: 100%;
    z-index: 50;
}

.logo,
.right-logo {
    width: 100px;
    height: 100px;
    border: 2px solid #8B4513;
    /* Brown border */
}

/* Main title and subtitle */
.main-title {
    font-size: 4rem;
    color: white;
    /* Changed to white for better contrast */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    /* Add shadow for depth */
}

.subtitle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    background: linear-gradient(to right, #8B4513, #654321);
    /* Brown gradient */
}

.subtitle {
    font-size: 24px;
    color: white;
    font-style: italic;
    text-align: center;
    flex-grow: 1;
    padding: 10px 0;
}

/* Main content container */
.content-container {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 200px);
    position: relative;
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    background: linear-gradient(to bottom, #f4ede4, #e2d3bc);
    border-right: 1px solid #cba16c;
    position: fixed;
    top: 220px;
    left: 0;
    bottom: 50px;
    overflow-y: auto;
    z-index: 51;
    padding: 0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.07);
    scrollbar-width: thin;
    scrollbar-color: #aa7744 #f4ede4;
    border-radius: 0 12px 12px 0;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f4ede4;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #aa7744;
    border-radius: 10px;
    border: 2px solid #f4ede4;
}

.sidebar-title {
    text-align: center;
    color: #5b3e1a;
    font-size: 24px;
    font-weight: 600;
    padding: 16px 12px;
    border-bottom: 2px solid #cba16c;
    margin-bottom: 0;
    background: linear-gradient(to right, #e7d3b8, #f4ede4);
    position: sticky;
    top: 0;
    z-index: 96;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.kosha-category {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(203, 161, 108, 0.3);
    position: relative;
}

.kosha-category-demo {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(203, 161, 108, 0.3);
    position: relative;
}

.category-header {
    background: linear-gradient(to right, #caa46e, #e6d2b1);
    color: #4c3014;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #9b6d3b;
    transition: all 0.3s ease;
    position: relative;
}

.category-header:hover {
    background: linear-gradient(to right, #b79161, #d6c0a4);
    padding-left: 22px;
}

.category-header.active {
    background: linear-gradient(to right, #b79161, #d6c0a4);
    border-left-color: #8B4513;
}

/* Fixed kosha list positioning */
.kosha-list {
    position: fixed;
    left: 270px;
    width: 290px;
    background: linear-gradient(to bottom, #f9f5ec, #ede1ce);
    border: 2px solid #cba16c;
    border-left: 3px solid #8B4513;
    border-radius: 12px;
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 999;
    max-height: 70vh;
    /* Limit height to 70% of viewport */
    overflow-y: auto;
    /* Enable scrolling for long lists */
}

/* Scrollbar styling for kosha list */
.kosha-list::-webkit-scrollbar {
    width: 6px;
}

.kosha-list::-webkit-scrollbar-track {
    background: #f9f5ec;
    border-radius: 10px;
}

.kosha-list::-webkit-scrollbar-thumb {
    background-color: #8B4513;
    border-radius: 10px;
}

.kosha-list.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

.kosha-list::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid #8B4513;
    z-index: 1000;
}

.kosha-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #6c4a27;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(203, 161, 108, 0.2);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    white-space: nowrap;
    /* Prevent text wrapping */
}

.kosha-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 0;
}

.kosha-item:first-child {
    border-radius: 0 10px 0 0;
}

.kosha-item:hover {
    background: linear-gradient(to right, #e6d2b1, #f4ede4);
    color: #40290e;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
    border-left: 4px solid #8B4513;
}

.kosha-item::before {
    content: '•';
    color: #8B4513;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #4e2e13;
    border-right: 2px solid #4e2e13;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.arrow.down {
    transform: rotate(135deg);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    z-index: 50;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 8%;
    margin-top: 3%;
    margin-bottom: 2%;
}

.nav-button {
    padding: 15px 30px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Add shadow for depth */
    border-radius: 5px;
    /* Rounded corners */
}

.nav-button:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    /* Reverse gradient on hover */
}

/* Home and Back buttons */
.utility-button {
    padding: 10px 20px;
    background: rgb(153, 101, 21);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.utility-button:hover {
    background: #5a3d17;
    transform: scale(1.05);
}

/* Search section */
.search-section {
    display: none;
    margin: 30px auto;
    max-width: 70%;
    text-align: center;
}

.search-instruction {
    font-size: 18px;
    margin-bottom: 15px;
    color: #000;
    text-align: center;
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.search-input {
    padding: 10px;
    width: 400px;
    border: 1px solid #8B4513;
    background: #fff;
    border-radius: 5px;
}

.paryaya-wrapper {
    position: relative;
    width: 400px;
}

.paryaya-dropdown {
    position: absolute;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #cba16c;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.paryaya-dropdown-item {
    padding: 12px 15px;
    border-bottom: 1px solid #cba16c;
    cursor: pointer;
    transition: background-color 0.2s;
}

.paryaya-dropdown-item:hover {
    background-color: #f4ede4;
}

.paryaya-dropdown-item:hover,
.paryaya-dropdown-item.highlightedParyaya {
    background-color: #f4ede4;
}

.search-button {
    padding: 10px 20px;
    background: #8B4513;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.search-button:hover {
    background: #654321;
    /* Darker brown on hover */
}

.keyboard-icon {
    position: absolute;
    right: 5%;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8B4513;
    font-size: 23px;
}

/* Home page content */
.welcome-text,
.instruction-text {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
    font-size: 18px;
    line-height: 1.5;
    color: #000;
    text-align: center;
}

/* New general search bar styles */
.general-search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px auto;
    max-width: 600px;
    position: relative;
}

.general-search-input {
    padding: 12px;
    width: 400px;
    border: 2px solid #8B4513;
    background: #fff;
    border-radius: 5px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.general-search-button {
    padding: 12px 25px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.general-search-button:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    transform: scale(1.03);
}

.general-keyboard-icon {
    position: absolute;
    right: 170px;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8B4513;
    font-size: 25px;
}

/* Category button in middle when selected */
.selected-category {
    display: flex;
    justify-content: center;
    margin: 3% auto 1%;
}

.selected-category .nav-button {
    padding: 18px 40px;
    font-size: 24px;
}

/* Sanskrit Keyboard Styles */
.sanskrit-keyboard {
    position: fixed;
    z-index: 1000;
    background: #f9f3e5;
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 10px;
    width: 450px;
    display: none;
    cursor: move;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #d7c4a3;
    margin-bottom: 8px;
}

.keyboard-title {
    font-weight: bold;
    color: #654321;
}

.keyboard-close {
    cursor: pointer;
    color: #8B4513;
    font-size: 16px;
    font-weight: bold;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.keyboard-key {
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #d7c4a3;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.keyboard-key:hover {
    background: #f0e6d2;
}

.keyboard-key:active {
    background: #e0d6c2;
    transform: scale(0.95);
}

.keyboard-spacebar {
    width: 200px;
}

.keyboard-backspace {
    width: 85px;
}

.keyboard-key.special {
    background-color: #f0e6d2;
}

/* Dictionary Results Styles */
#resultsContainer {
    max-width: 90%;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    display: none;
}

.result-card {
    background-color: #f9f9f9;
    border-left: 4px solid #8B4513;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: translateX(5px);
    background-color: #f0e6d2;
}

.result-title {
    font-weight: bold;
    color: #654321;
}
.word-info {
    margin-bottom: 8px;
}

.english_meaning {
    font-size: 16px;
    margin-left: 8px;
}

.headword {
    font-size: 16px;
    margin-left: 8px;
}

.word-value {
    font-weight: bold;
}

.gender {
    display: inline-block;
    background-color: #e0f2f1;
    color: #8B4513;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

.synonyms {
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
    color: #8B4513;
}

/* Kosha buttons styling */
.kosha-buttons {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.kosha-button {
    padding: 8px 18px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kosha-button:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    transform: scale(1.03);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.modal-content {
    background-color: white;
    width: 80%;
    max-width: 550px;
    margin: 100px auto;
    padding: 20px 30px;
    border-radius: 5px;
    position: relative;
    max-height: 450px;
    overflow-y: auto;
    border: 2px solid #8B4513;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #8B4513;
}

#modalTitle {
    color: #8B4513;
    border-bottom: 1px solid #d7c4a3;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* New styles for synonym words */
.synonym-word {
    display: inline-block;
    margin-right: 5px;
    color: #3f51b5;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.synonym-word:hover {
    color: #1a237e;
    text-decoration: underline;
}

/* Tooltip styles */
.tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: #333;
    text-align: center;
    border-radius: 6px;
    padding: 3px 6px;
    max-width: 170px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    pointer-events: none;
    width: max-content;
}

/* Arrow for tooltip */
.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.synonym-word:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip-content {
    text-align: left;
    line-height: 1.4;
}

.tooltip-section {
    display: flex;
    margin-bottom: 3px;
}

.tooltip-label {
    font-weight: bold;
    margin-right: 5px;
    color: #555;
    width: 60px;
}

.kosha-samavaya-heading {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
}

.kosha-samavaya-heading h2 {
    color: #333;
    font-size: 1.8rem;
    margin: 0;
    padding: 0;
    font-weight: bold;
}

.kosha-samavaya-heading .heading-text {
    background-color: #f5f5f5;
    padding: 5px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #d1a05f;
    display: inline-block;
}
.input-word-display {
    background: linear-gradient(to right, #e7d3b8, #f4ede4);
    border: 2px solid #8B4513;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    max-width: 42%;
    margin: 20px auto;
}

.sloka-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    font-size: 14px;
}

.sloka-button:hover {
    background: linear-gradient(135deg, #654321, #8B4513);
}
.show-sloka-btn {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    float: right;
}

.show-sloka-btn:hover {
    background: linear-gradient(135deg, #654321, #8B4513);
}

.input-word-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    font-weight: 900 !important;
    position: relative;
    transition: all 0.3s ease;
    color: transparent;
    cursor: pointer;
}

.input-word-highlight:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent;
    transform: scale(1.05);
}
.footer-bar {
    position: absolute;
    text-align: center;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 14px;
    color: #333;
    padding: 12px 20px;
    width: 100%;
}

.footer-links {
    position: absolute;
    right: 20px;
    bottom: 5px;
    display: flex;
    gap: 10px;
}

.footer-button {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    background: linear-gradient(to bottom, #B87534, #9C5B28);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.footer-button:hover {
    background: linear-gradient(to bottom, #4E2A0A, #6B3E15);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-content {
        margin-left: 220px;
    }

    .sidebar {
        width: 220px;
    }
}

@media (max-width: 992px) {
    .main-content {
        margin-left: 200px;
    }

    .sidebar {
        width: 200px;
    }

    .footer-links {
        position: static;
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 600px) {
    .ontology-submit-btn {
        width: 100%;
        margin-left: 0;
    }

    #ontologyWordInput {
        width: 100%;
    }
}

/* Avyayapada specific styles */
.avyaya-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: none;
    /* Hidden by default */
}
.avyaya-sloka-btn {
    padding: 0 20px;
    background-color: #d2691e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1.1rem;
    margin-left: 10px;
}

.avyaya-sloka-btn:hover {
    background-color: #b8860b;
}

.avyaya-sloka-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.avyaya-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #8B4513;
    font-size: 2.5rem;
}

.avyaya-search-container {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.avyaya-search-input {
    flex: 1;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 5px 0 0 5px;
    outline: none;
    transition: border-color 0.3s;
}

.avyaya-search-input:focus {
    border-color: #8B4513;
}

.avyaya-search-btn {
    padding: 0 20px;
    background-color: #8B4513;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1.1rem;
}

.avyaya-search-btn:hover {
    background-color: #704214;
}

.avyaya-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: calc(100% - 65px);
    max-height: 140px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 10;
    display: none;
}

.avyaya-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.avyaya-suggestion-item:hover {
    background-color: #f9f9f9;
}

.avyaya-result-container {
    margin-top: 30px;
    display: none;
}

.avyaya-word-display {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
    color: #8B4513;
    padding: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.avyaya-meaning-section {
    margin-bottom: 30px;
}

.avyaya-meaning-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #555;
}

.avyaya-meaning-list {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    line-height: 1.8;
    font-size: 1.1rem;
    display: flex;
    flex-wrap: wrap;
}

.avyaya-kosha-btns {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    flex-wrap: wrap;
}

.avyaya-kosha-btn {
    flex: 1;
    padding: 12px;
    margin: 0 5px;
    background-color: #ddd;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.avyaya-kosha-btn:hover {
    background-color: #ccc;
    transform: translateY(-2px);
}

.avyaya-kosha-btn.active {
    background-color: #8B4513;
    color: white;
}

.avyaya-loading {
    text-align: center;
    margin: 20px 0;
    display: none;
}

.avyaya-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(139, 69, 19, 0.3);
    border-radius: 50%;
    border-top-color: #8B4513;
    animation: avyaya-spin 1s linear infinite;
}

.avyaya-word-label {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}

.avyaya-meaning-item {
    cursor: pointer;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 5px;
    padding: 3px 6px;
    /* background-color: #f0f0f0; */
    border-radius: 4px;
    transition: background-color 0.2s;
}

.avyaya-meaning-item:hover {
    background-color: #e0e0e0;
}

.avyaya-meaning-item:not(:last-child)::after {
    content: " , ";
}

/* Popup styles for avyaya */
.avyaya-kosha-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.avyaya-popup-content {
    background-color: #fff;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 80vh;
}

.avyaya-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.3s;
}

.avyaya-popup-close:hover {
    color: #333;
}

.avyaya-popup-title {
    font-size: 1.8rem;
    color: #8B4513;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.avyaya-popup-word {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 25px;
    color: #555;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.avyaya-kosha-meanings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.avyaya-kosha-meaning {
    margin: 5px;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    position: relative;
    display: inline-block;
    transition: background-color 0.2s;
}

.avyaya-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 6px;
    border-radius: 5px;
    max-width: 200px;
    display: none;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: max-content;
    pointer-events: none;
}

.avyaya-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.avyaya-tooltip-item {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.avyaya-tooltip-label {
    font-weight: bold;
    margin-right: 5px;
}

.avyaya-no-meanings {
    text-align: center;
    padding: 20px;
    color: #777;
    font-style: italic;
}

.avyaya-no-results {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 1.2rem;
    display: none;
}

.avyaya-disabled-button {
    opacity: 0.6;
    cursor: not-allowed;
}

.avyaya-keyboard-icon {
    position: absolute;
    right: 175px;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8B4513;
    font-size: 25px;
}

@keyframes avyaya-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .avyaya-kosha-btns {
        flex-direction: column;
    }

    .avyaya-kosha-btn {
        margin: 5px;
    }

    .avyaya-popup-content {
        width: 95%;
        padding: 20px;
    }
}

.Avyaya_pada_synonym_modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.Avyaya_pada_synonym_modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.Avyaya_pada_synonym_modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    flex-shrink: 0;
}

.Avyaya_pada_synonym_modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    text-align: center;
}

.Avyaya_pada_synonym_close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.Avyaya_pada_synonym_close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.Avyaya_pada_synonym-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: 50vh;
}

.Avyaya_pada_synonym-results-container::-webkit-scrollbar {
    width: 6px;
}

.Avyaya_pada_synonym-results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.Avyaya_pada_synonym-results-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.Avyaya_pada_synonym-results-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.Avyaya_pada_synonym-result-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background-color: #ffffff;
    transition: box-shadow 0.2s;
}

.Avyaya_pada_synonym-result-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.Avyaya_pada_synonym-result-card:last-child {
    margin-bottom: 0;
}

.Avyaya_pada_synonym-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.Avyaya_pada_synonym-word-info {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.Avyaya_pada_synonym-word-value {
    font-weight: 600;
    color: #2196F3;
}

.Avyaya_pada_synonym-gender-tag,
.Avyaya_pada_synonym-english-tag {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 9px;
    font-weight: 500;
}

.Avyaya_pada_synonym-gender-tag {
    background-color: #4CAF50;
    color: white;
}

.Avyaya_pada_synonym-english-tag {
    background-color: #FF9800;
    color: white;
}

.Avyaya_pada_synonym-list {
    line-height: 1.4;
    margin-top: 8px;
}

.Avyaya_pada_synonym-word-item {
    display: inline-block;
    background-color: #e3f2fd;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 0.85em;
}

.Avyaya_pada_synonym-word-item:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
}

.Avyaya_pada_synonym-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.Avyaya_pada_synonym-word-item:hover .Avyaya_pada_synonym-tooltip {
    opacity: 1;
    visibility: visible;
}

.Avyaya_pada_synonym-loading {
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .Avyaya_pada_synonym_modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .Avyaya_pada_synonym_modal-header {
        padding: 12px 16px;
    }

    .Avyaya_pada_synonym-results-container {
        padding: 12px 16px;
        max-height: 45vh;
    }

    .Avyaya_pada_synonym-result-card {
        padding: 10px;
    }
}

/* Gana-specific styles */
.gana-container {
    display: none;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.gana-search-container {
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    /* space between input and button */
    flex-wrap: wrap;
}

.gana-search-input-container {
    position: relative;
    max-width: 600px;
    flex-grow: 1;
    min-width: 250px;
    /* margin: 0 auto 20px; */
}

.gana-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #8B4513;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.gana-search-input:focus {
    outline: none;
    border-color: #654321;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

.gana-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #8B4513;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.gana-dropdown.show {
    display: block;
}

.gana-dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    color: #5b3e1a;
}

.gana-dropdown-item:hover,
.gana-dropdown-item.active {
    background-color: #f4ede4;
    color: #40290e;
}

.gana-dropdown-item:last-child {
    border-bottom: none;
}

.gana-no-items {
    padding: 15px 20px;
    color: #888;
    text-align: center;
    font-style: italic;
}

.gana-search-button {
    padding: 15px 25px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.gana-search-button:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.gana-main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: 30px;
    min-height: 400px;
}

.gana-no-data {
    text-align: center;
    color: #666;
    padding: 60px 20px;
}

.gana-no-data h3 {
    color: #5b3e1a;
    font-size: 24px;
    margin-bottom: 15px;
}

.gana-no-data p {
    font-size: 16px;
    color: #888;
}

.gana-loading {
    text-align: center;
    padding: 60px 20px;
}

.gana-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.gana-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.gana-content-title {
    color: #5b3e1a;
    font-size: 28px;
    font-weight: 600;
}

.gana-set-count {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    margin-left: 10px;
}

.gana-sloka-btn {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.gana-sloka-btn:hover {
    background: linear-gradient(135deg, #654321, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}

.gana-word-container {
    margin-top: 20px;
}

.gana-headword-title {
    background: linear-gradient(135deg, #f4ede4, #e2d3bc);
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #5b3e1a;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    border-left: 5px solid #8B4513;
}

.gana-headword-title.expanded {
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #caa46e, #e6d2b1);
    background: linear-gradient(135deg, #f4ede4, #e2d3bc);
}

.gana-headword-title:hover:not(.expanded) {
    background: linear-gradient(135deg, #e2d3bc, #d6c0a4);
    transform: translateX(5px);
}

.gana-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.gana-headword-title.expanded .gana-arrow {
    transform: rotate(180deg);
}

.gana-word-list {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e0e0e0;
    border-top: none;
    margin-bottom: 15px;
}

.gana-word-item {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    color: #5b3e1a;
    font-weight: 500;
}

.gana-word-item:hover {
    background: linear-gradient(135deg, #f4ede4, #e2d3bc);
    border-color: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.2);
}

/* Modal styles for Gana */
.gana-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.gana-modal-content {
    background-color: #fefefe;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gana-modal-header {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 20px 30px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gana-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.gana-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.gana-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.gana-modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.gana-sanskrit-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    text-align: center;
}

.gana-kosha-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 5px solid #8B4513;
}

.gana-kosha-header {
    color: #5b3e1a;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.gana-word-details-container {
    max-height: 50vh;
    overflow-y: auto;
}

.gana-kosha-title {
    color: #5b3e1a;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.gana-word-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.gana-detail-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.gana-detail-label {
    font-weight: 600;
    color: #5b3e1a;
    min-width: 120px;
    flex-shrink: 0;
}

.gana-detail-value {
    color: #333;
    flex: 1;
}

.gana-gender-label {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

/* Responsive design for Gana */
@media (max-width: 768px) {
    .gana-container {
        padding: 10px;
    }

    .gana-search-container {
        padding: 20px;
    }

    .gana-modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .gana-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Nanartha specific styles */
.nanartha-keyboard-icon {
    position: absolute;
    right: 5%;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8B4513;
    font-size: 25px;
}

.nanartha-search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.nanartha-search-input {
    padding: 10px;
    width: 400px;
    border: 1px solid #8B4513;
    background: #fff;
    border-radius: 5px;
}

.nanartha-search-button {
    padding: 10px 20px;
    background: #8B4513;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.nanartha-search-button:hover {
    background: #654321;
    /* Darker brown on hover */
}

.nanartha-wrapper {
    position: relative;
    width: 400px;
}

.nanartha-results-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: none;
    max-width: 900px;
    margin: 20px auto;
}

.nanartha-word-header {
    display: flex !important;;
    align-items: center !important;;
    justify-content: space-between !important;;
    margin-bottom: 15px;
    border-bottom: 2px solid #f4ede4;
    padding-bottom: 8px;
}
.nanartha-sloka-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.nanartha-sloka-btn:hover {
    background: linear-gradient(135deg, #654321, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}
.nanartha-word-title {
    font-size: 2rem;
    color: #8B4513;
    margin-right: 15px;
}

.nanartha-word-block {
    display: flex;
    gap: 20px;
}

.nanartha-anchor-block {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.nanartha-anchor-word {
    font-weight: 500;
    color:#8B4513;;
    font-size: 25px;
    display: flex;
}

.nanartha-word-gender {
    background-color: #ff9800;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.nanartha-meanings-title {
    font-size: 1.5rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.nanartha-meanings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.nanartha-meaning-item {
    background-color: #f4ede4;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.nanartha-meaning-item:hover {
    background-color: #e2d3bc;
}

.nanartha-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 1);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    max-width: 170px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: max-content;
    pointer-events: none;
}

.nanartha-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 1) transparent transparent transparent;
}

.nanartha-meaning-item:hover .nanartha-tooltip {
    visibility: visible;
    opacity: 1;
}

.nanartha-source-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nanartha-source-btn {
    background-color: #8B4513;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.nanartha-source-btn:hover {
    background-color: #654321;
}

.nanartha-source-btn.disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    opacity: 0.6;
}

.nanartha-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.nanartha-modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    position: relative;
}

.nanartha-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.nanartha-close-btn:hover {
    color: #8B4513;
}

.nanartha-modal-title {
    font-size: 1.8rem;
    text-align: center;
    color: #8B4513;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f4ede4;
}

.nanartha-modal-word-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.nanartha-modal-word {
    font-size: 1.5rem;
    color: #8B4513;
    margin-right: 15px;
}

.nanartha-modal-gender {
    background-color: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.nanartha-modal-meanings-title {
    font-size: 1.3rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.nanartha-modal-meanings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nanartha-no-meanings-message {
    font-style: italic;
    color: #888;
    padding: 10px;
    text-align: center;
}

.nanartha-word-forms-container {
    font-size: 21px;
}

.nanartha-word-form-item {
    margin: 3px 0;
    padding-left: 20px;
    position: relative;
}

.nanartha-word-form-item strong {
    margin-right: 5px;
}

.nanartha-gender-highlight {
    display: inline-block;
    background-color: #ff9800;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-left: 5px;
}

.nanartha-pratipadika-container {
    position: relative;
    display: inline-block;
    font-size: 25px;
}

.nanartha-dropdown {
    position: absolute;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #cba16c;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.nanartha-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #cba16c;
    transition: background-color 0.2s;
}

.nanartha-dropdown-item:hover {
    background-color: #f4ede4;
}

.nanartha_pada_synonym_modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.nanartha_pada_synonym_modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.nanartha_pada_synonym_modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    flex-shrink: 0;
}

.nanartha_pada_synonym_modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    text-align: center;
}

.nanartha_pada_synonym_close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.nanartha_pada_synonym_close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nanartha_pada_synonym-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: 50vh;
}

.nanartha_pada_synonym-results-container::-webkit-scrollbar {
    width: 6px;
}

.nanartha_pada_synonym-results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nanartha_pada_synonym-results-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.nanartha_pada_synonym-results-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.nanartha_pada_synonym-result-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background-color: #ffffff;
    transition: box-shadow 0.2s;
}

.nanartha_pada_synonym-result-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nanartha_pada_synonym-result-card:last-child {
    margin-bottom: 0;
}

.nanartha_pada_synonym-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.nanartha_pada_synonym-word-info {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.nanartha_pada_synonym-word-value {
    font-weight: 600;
    color: #2196F3;
}

.nanartha_pada_synonym-gender-tag,
.nanartha_pada_synonym-english-tag {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 9px;
    font-weight: 500;
}

.nanartha_pada_synonym-gender-tag {
    background-color: #4CAF50;
    color: white;
}

.nanartha_pada_synonym-english-tag {
    background-color: #FF9800;
    color: white;
}

.nanartha_pada_synonym-list {
    line-height: 1.4;
    margin-top: 8px;
}

.nanartha_pada_synonym-word-item {
    display: inline-block;
    background-color: #e3f2fd;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 0.85em;
}

.nanartha_pada_synonym-word-item:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
}

.nanartha_pada_synonym-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.nanartha_pada_synonym-word-item:hover .nanartha_pada_synonym-tooltip {
    opacity: 1;
    visibility: visible;
}

.nanartha_pada_synonym-loading {
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .nanartha_pada_synonym_modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .nanartha_pada_synonym_modal-header {
        padding: 12px 16px;
    }

    .nanartha_pada_synonym-results-container {
        padding: 12px 16px;
        max-height: 45vh;
    }

    .nanartha_pada_synonym-result-card {
        padding: 10px;
    }
}

/* general section */
.general-results-container {
    display: none;
    margin: 20px auto;
    max-width: 900px;
    padding: 0 20px;
}

.general-result-card {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 10px;
    margin: 20px 0;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.general-result-title {
    font-size: 20px;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 10px;
}

.general-word-info {
    margin-bottom: 15px;
    font-size: 16px;
}

.general-word-value {
    font-weight: bold;
    color: #5b3e1a;
    font-size: 18px;
    margin-left: 12px;
}

.general-word-value-gana {
    font-weight: bold;
    color: #5b3e1a;
    font-size: 18px;
    text-align: center;
}

.general-gender,
.general-english_meaning {
    margin-left: 15px;
    padding: 3px 8px;
    background: #f4ede4;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    color: #6c4a27;
}

.general-synonyms {
    line-height: 1.6;
    display: inline;
}

.general-synonym-word {
    color: #8B4513;
    cursor: pointer;
    text-decoration: underline;
    position: relative;
    margin: 2px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.general-synonym-word:hover {
    background-color: #f4ede4;
    color: #5b3e1a;
}

/* Tooltip styles */
.general-tooltip {
    display: none;
    position: absolute;
    background: #333;
    color: white;
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 13px;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
    max-width: 170px;
    width: max-content;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.general-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.general-synonym-word:hover .general-tooltip {
    display: block;
}

.general-kosha-meaning:hover .general-tooltip {
    display: block;
}

.general-tooltip-content {
    font-size: 13px;
}

.general-tooltip-section {
    margin: 2px 0;
}

.general-tooltip-label {
    font-weight: bold;
}

/* Kosha buttons */
.general-kosha-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.general-kosha-button {
    padding: 8px 16px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.general-kosha-button:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    transform: scale(1.05);
}

.general-kosha-button.active {
    background: linear-gradient(to bottom, #3e2610, #2b1a0a);
    color: #FFD700;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 5px #FFD700;
    transform: scale(1.03);
}

/* Kosha content sections */
.general-kosha-content {
    display: none;
    margin: 20px 0;
    padding: 15px;
    background: #f9f5ec;
    border-left: 4px solid #8B4513;
    border-radius: 5px;
}

.general-kosha-content h3 {
    color: #5b3e1a;
    margin-bottom: 10px;
    font-size: 18px;
}

/* Avyaya section styles */
.general-avyaya-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border: 2px solid #8B4513;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1)
}

.general-avyaya-title {
    color: #4682b4;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.general-meaning-section {
    margin: 15px 0;
}

.general-meaning-title {
    color: #5b3e1a;
    font-size: 18px;
    margin-bottom: 10px;
}

.general-meaning-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.general-meaning-item {
    background: #e6f3ff;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #4682b4;
    color: #2c5aa0;
}

.general-kosha-meaning {
    display: inline-block;
    background: #fff;
    padding: 8px 12px;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.general-kosha-meaning:hover {
    background: #f0f8ff;
    border-color: #4682b4;
}

/* Loading indicator */
.general-loading {
    display: none;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #8B4513;
}

.general-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

.general-input-word-display {
    background: linear-gradient(to right, #e7d3b8, #f4ede4);
    border: 2px solid #8B4513;
    padding: 10px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    display: none;
}

.general-sloka-button {
    padding: 6px 12px;
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    border: none;
    border-radius: 4px;
    margin: 10px;
    cursor: pointer;
    font-size: 14px;
    float: right;
}

.general-sloka-button:hover {
    background: linear-gradient(135deg, #654321, #8B4513);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* general gana style */
.general-no-results {
    display: none;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #666;
    background: #f9f9f9;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 600px;
}

.gana-item {
    margin-bottom: 10px;
}

/* Inline Gana Details Container */
.gana-details-inline {
    margin-top: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

/* Gana Details Header */
.gana-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B4513;
    flex-wrap: wrap;
    gap: 10px;
}

.gana-details-header h3 {
    margin: 0;
    color: #8B4513;
    font-size: 1.4em;
    flex: 1;
    min-width: 200px;
}

/* Inline Back Button */
.back-button-inline {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.back-button-inline:hover {
    background-color: #5a6268;
}

/* Inline Sloka Button */
.sloka-btn-inline {
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.sloka-btn-inline:hover {
    background-color: #A0522D;
}

/* Word Container Inline */
.word-container-inline {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background-color: white;
}

/* Headword Title Inline */
.headword-title-inline {
    background-color: #e9ecef;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #495057;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.headword-title-inline:hover {
    background-color: #dee2e6;
    border-left-color: #8B4513;
}

.headword-title-inline.expanded {
    background-color: #8B4513;
    color: white;
    border-left-color: #A0522D;
}

/* Toggle Arrow Small */
.toggle-arrow-small {
    font-size: 12px;
    transition: transform 0.3s;
    font-weight: bold;
}

.headword-title-inline.expanded .toggle-arrow-small {
    transform: rotate(180deg);
}

/* Word List Inline */
.word-list-inline {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #8B4513;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Word Item Inline */
.word-item-inline {
    background-color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.word-item-inline:hover {
    background-color: #8B4513;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: #8B4513;
}

/* General Set Link */
.general-set-link {
    cursor: pointer;
    color: #8B4513;
    text-decoration: underline;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.general-set-link:hover {
    color: #A0522D;
    text-decoration-color: #A0522D;
}

.general-set-link.active {
    color: #A0522D;
    font-weight: bold;
    text-decoration: none;
    background-color: rgba(139, 69, 19, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Toggle Arrow */
.toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s;
    font-weight: bold;
}

.general-set-link.active .toggle-arrow {
    transform: rotate(180deg);
}

/* Set Count */
.set-count {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: normal;
}

/* Error Message */
.error-message {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 10px 0;
}

/* Loading Styles */
.general-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.general-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8B4513;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gana-details-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .gana-details-header h3 {
        text-align: center;
        min-width: auto;
    }

    .back-button-inline,
    .sloka-btn-inline {
        width: 100%;
        text-align: center;
    }

    .word-container-inline {
        max-height: 300px;
    }

    .word-list-inline {
        gap: 8px;
        padding: 10px;
    }

    .word-item-inline {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Enhanced Visual Effects */
.gana-details-inline:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.word-container-inline::-webkit-scrollbar {
    width: 6px;
}

.word-container-inline::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.word-container-inline::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 3px;
}

.word-container-inline::-webkit-scrollbar-thumb:hover {
    background: #A0522D;
}

.general-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.general-modal-content {
    background-color: #fefefe;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.general-modal-header {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 20px 30px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.general-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.general-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.general-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.general-modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.general-sanskrit-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    text-align: center;
}

.general-kosha-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 5px solid #8B4513;
}

.general-kosha-header {
    color: #5b3e1a;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.general-word-details-container {
    max-height: 50vh;
    overflow-y: auto;
}

.general-kosha-title {
    color: #5b3e1a;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.general-word-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.general-detail-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.general-detail-label {
    font-weight: 600;
    color: #5b3e1a;
    min-width: 120px;
    flex-shrink: 0;
}

.general-detail-value {
    color: #333;
    flex: 1;
}

.general-gender-label {
    background: linear-gradient(135deg, #8B4513, #654321);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

.general-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.general-no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Ontology-specific styles */
.ontology-section {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    border-top: 4px solid #8B4513;
    max-width: 950px;
    display: none;
    width: 90%;
    /* Ensure full width within container */
    box-sizing: border-box;
}

.ontology-keyboard-icon {
    position: absolute;
    right: 15px;
    top: 38%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8B4513;
    font-size: 25px;
}

.ontology-search-field {
    position: relative;
    margin-bottom: 20px;
}

.ontology-search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #8B4513;
    font-size: 16px;
}

.ontology-search-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: #fafafa;
    transition: all 0.3s;
    color: #4A3728;
}

.ontology-search-field input:focus {
    outline: none;
    border-color: #CD853F;
    box-shadow: 0 0 0 2px rgba(205, 133, 63, 0.2);
    background-color: white;
}

.ontology-dropdown-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ontology-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    color: #4A3728;
}

.ontology-dropdown-item:hover,
.ontology-dropdown-item.highlighted {
    background-color: #F5DEB3;
    color: #8B4513;
}

.ontology-dropdown-item:last-child {
    border-bottom: none;
}

.ontology-no-suggestions {
    padding: 12px 15px;
    color: #666;
    font-style: italic;
}

.ontology-submit-btn {
    background: linear-gradient(to bottom, #8B4513, #654321);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

.ontology-submit-btn:hover {
    background: linear-gradient(to bottom, #654321, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.ontology-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.ontology-results-section {
    margin-top: 30px;
    display: none;
}

.ontology-input-word {
    background: linear-gradient(135deg, #8B4513, #CD853F);
    color: white;
    font-size: 18px;
    font-weight: 600;
    padding: 15px 25px;
    margin-bottom: 25px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ontology-trees-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 20px;
}

.ontology-tree-wrapper {
    flex: 1;
    min-width: 300px;
    max-width: 370px;
    background: linear-gradient(145deg, #f8f9fa, #fff);
    border-radius: 12px;
    border-left: 5px solid #CD853F;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.ontology-tree-header {
    font-size: 18px;
    color: #8B4513;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #CD853F;
}

.ontology-tree-root,
.ontology-child-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.ontology-child-list {
    padding-left: 20px;
    margin-top: 5px;
}

.ontology-tree-node {
    position: relative;
    margin: 5px 0;
}

.ontology-tree-label {
    cursor: pointer;
    font-weight: 500;
    background: linear-gradient(145deg, #f9f9f9, #ffffff);
    border-left: 4px solid #CD853F;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #4A3728;
}

.ontology-tree-label:hover {
    background: linear-gradient(145deg, #F5DEB3, #fff);
    color: #8B4513;
    transform: translateX(3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ontology-toggle-icon {
    font-size: 12px;
    margin-left: 10px;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.ontology-child-list.collapsed {
    display: none;
}

.ontology-tree-node.leaf .ontology-toggle-icon {
    display: none;
}

.ontology-tree-node.leaf .ontology-tree-label {
    background: linear-gradient(145deg, #e8f5e8, #f0f8f0) !important;
    border-left-color: #4caf50 !important;
    color: #2e7d32 !important;
}

.ontology-tree-node.leaf .ontology-tree-label:hover {
    background: linear-gradient(145deg, #c8e6c9, #e8f5e8) !important;
    color: #1b5e20 !important;
}

.ontology-tree-root>.ontology-tree-node:first-child .ontology-tree-label {
    background: linear-gradient(to bottom, #f4ede4, #e2d3bc);
    font-weight: 600;
    border-left-color: #8B4513;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.ontology-tree-root>.ontology-tree-node:first-child .ontology-tree-label:hover {
    background: linear-gradient(135deg, #CD853F, #8B4513);
    transform: translateX(3px);
    color: white;
    box-shadow: 0 6px 12px rgba(139, 69, 19, 0.3);
}

.ontology-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
}

.ontology-loading {
    text-align: center;
    padding: 30px;
    color: #8B4513;
    font-size: 18px;
}

.ontology-loading::after {
    content: '...';
    animation: ontologyDots 1.5s steps(5, end) infinite;
}

@keyframes ontologyDots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}