:root {
  /* Light theme variables */
  --body: linear-gradient(180deg, #FFF 0%, #EEF1F4 100%);/* Change the background color of the right side content */
  --navbar: rgb(229, 231, 235);
  --main-sidebar: linear-gradient(180deg, #00308f 0%, #0038A8 100%); /* Change the background color of the sidebar */
  --metrics-card: linear-gradient(98deg, #081F62 0.54%, #003B7F 99.46%); /* Change the background color of the metrics cards in dashboard */
  --metrics-card-text: rgb(255, 255, 255); /* Change the text color of the metrics cards in dashboard */
  --metrics-card-btn-text: rgb(255, 255, 255);
  --metric-card-icon-bg: rgb(255, 255, 255);
  --metric-card-icon: rgba(15, 60, 95, 1);
  --card-wrapper: rgb(255, 255, 255); /* Change the background color of the content wrapper */
  --card-border: rgba(208, 214, 221, 1);
  --user-container-card: rgba(242, 243, 245, 0.2); /* Change the background color of the user container */
  --menu-focus: rgba(1, 31, 89, 1); /* Change the background color of the sidebar menu focus */
  --menu-focus-treeview: rgb(1, 31, 89, .5);
  --menu-focus-text: rgba(252, 209, 22, 1);
  --menu-list: rgb(255, 255, 255); /* Change the text color of the sidebar menu */
  --icon-menu: rgb(15, 60, 95);
  --title-font: rgb(75, 85, 99);
  --btn-text: rgb(15, 60, 95);
  --btn-bg: rgba(208, 214, 221, 1);
  --btn-hover: rgba(0, 56, 168, 1);
  --btn-hover-text: rgb(255, 255, 255);
  --btn-primary: rgba(0, 56, 168, 1);
  --btn-info: rgba(15, 60, 95, 1);
  --btn-success: rgba(0, 121, 5, 1);
  --btn-warning: rgba(206, 17, 38, 1);
  --btn-hover-primary: rgb(1, 33, 95);
  --btn-hover-info: rgb(3, 26, 44);
  --btn-hover-success: rgb(2, 66, 4);
  --btn-hover-warning: rgb(117, 4, 17);
  --add-btn-bg: rgba(15, 60, 95, 1);
  --add-btn-hover: rgb(0, 39, 197);
  --view-btn-bg: rgb(0, 100, 194);
  --view-btn-hover: rgb(2, 82, 156);
  --edit-btn-bg: rgb(13, 202, 240);
  --edit-btn-hover: rgb(0, 162, 194);
  --delete-btn-bg: rgb(220, 53, 69);
  --delete-btn-hover: rgb(167, 26, 40);
  --table-header: rgba(15, 60, 95, 1);
  --table-footer-bg: rgb(229, 231, 235);
}

[data-bs-theme="dark"] {
  /* Override with dark mode equivalents */
  --body: rgba(19, 25, 31, 1);
  --navbar: rgba(46, 51, 56, 1);
  --main-sidebar: rgba(28, 31, 34, 1);
  --metrics-card: rgba(208, 214, 221, 0.2);   
  --metrics-card-text: rgb(255, 255, 255); 
  --metrics-card-btn-text: rgb(44, 44, 44);
  --metrics-card-text: rgb(255, 255, 255);
  --metric-card-icon-bg: rgb(255, 255, 255);
  --metric-card-icon: rgba(15, 60, 95, 1);
  --card-wrapper: rgb(26, 38, 51); 
  --user-container-card: rgba(15, 60, 95, 1);
  --menu-focus: rgba(1, 31, 89, 1);
  --menu-focus-treeview: rgb(1, 31, 89, .5);
  --menu-focus-text: rgba(252, 209, 22, 1);
  --menu-list: rgb(255, 255, 255);
  --icon-menu: rgb(255, 255, 255);
  --btn-text: rgb(255, 255, 255);
  --btn-bg: rgba(208, 214, 221, .2);
  --btn-hover: rgb(0, 78, 233);
  --btn-primary: rgba(0, 56, 168, 1);
  --btn-info: rgba(15, 60, 95, 1);
  --btn-success: rgba(0, 121, 5, 1);
  --btn-warning: rgba(206, 17, 38, 1);
  --btn-hover-primary: rgba(0, 56, 168, 1);
  --btn-hover-info: rgba(15, 60, 95, 1);
  --btn-hover-success: rgba(0, 121, 5, 1);
  --btn-hover-warning: rgba(206, 17, 38, 1);
  --btn-hover-text: rgb(255, 255, 255);
  --add-btn-bg: rgba(30, 67, 218, 1);
  --add-btn-hover: rgb(7, 32, 131);
  --view-btn-bg: rgb(0, 100, 194);
  --view-btn-hover: rgb(2, 82, 156);
  --edit-btn-bg: rgb(13, 202, 240);
  --edit-btn-hover: rgb(0, 162, 194);
  --delete-btn-bg: rgb(220, 53, 69);
  --delete-btn-hover: rgb(167, 26, 40);
  --table-header: rgb(11, 43, 68);
  --table-footer-bg: rgba(0, 56, 168, 0.3);
}

.thesaurus-container {
    margin: 0 auto;
    padding: 2rem 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Header & Title */
.thesaurus-header {
    margin-bottom: 2rem;
    text-align: center;
}

.thesaurus-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--btn-text);
    margin-bottom: 0.75rem;
}

.thesaurus-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--btn-text);
    margin-bottom: 0.75rem;
}

.thesaurus-description {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto;
}

/* Modern Search Component */
.search-container-thesaurus {
    max-width: 1000px;
    margin: 2rem auto;
}

.search-input-wrapper {
    display: flex;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--btn-primary);
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background-color: var(--btn-primary);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0 0.75rem 0.75rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: var(--btn-hover-primary);
}

.search-button i {
    font-size: 1rem;
}

/* Alphabet Navigation Bar */
.alphabet-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgb(229, 231, 235);
    padding: .1rem 0;
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.alphabet-scroller {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* For Firefox */
}

.alphabet-scroller::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}

.letter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    background-color: var(--btn-bg) !important;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.letter-link:hover {
    background-color: #e2e8f0;
    color: var(--btn-text) !important;
    transform: translateY(-2px);
}

.letter-link.active {
   background-color: var(--btn-primary) !important;
   color: var(--menu-list) !important;
}

/* Letter Headings & Groups */
.letter-group {
    margin-bottom: 2.5rem;
    animation: fadeIn 0.4s ease;
}

.letter-heading-container {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.letter-heading {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    padding-right: 1rem;
}

.letter-count {
    font-size: 0.95rem;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    background-color: #f1f5f9;
    border-radius: 1rem;
    margin-right: 1rem;
}

.letter-heading-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--btn-primary), transparent);
}

/* Terms Grid */
.terms-grid {
    display: flex;
    flex-direction: column;
}

.term-list {
    display: flex;
    flex-direction: column;
}

.preferred-term-label {
    padding-left: 2rem;
    font-size: 1.2rem !important;
}

.term-use {
    padding-left: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.term-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-size: 1.5rem; /* Original size that was causing the issue */
}

.term-use > a {
    color: var(--btn-text) !important;
    font-weight: 500; 
}

.term-use > a:hover {
    color: var(--btn-primary) !important;
}

.term-item:hover {
    color: var(--btn-primary) !important;
}

.term-unlink {
    color: var(--btn-text);
    text-decoration: none;
    line-height: 1.5;
    transition: all 0.2s ease;
    font-weight: 600; 
}

.term-link {
    display: block;
    color: var(--btn-text);
    text-decoration: none;
    line-height: 1.5;
    transition: all 0.2s ease;
    font-weight: 600;
}

.term-link:hover {
    color: var(--btn-text) !important;
    transform: translateX(4px);
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
}

.load-more-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--btn-text);
    background-color: var(--btn-bg) !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-button:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
    color: var(--btn-text) !important;
}

/* Search Results Styling */
.search-results {
    background-color: var(--card-wrapper);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.search-result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--btn-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.search-result-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.search-result-item .term-link {
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.search-result-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Button Styling */
.thesaurus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.thesaurus-btn-primary {
    background-color: var(--btn-primary);
    color: white;
    border: none;
}

.thesaurus-btn-primary:hover {
    background-color: var(--btn-hover-primary);
    transform: translateY(-2px);
}

.thesaurus-btn-success {
    background-color: #10b981;
    color: white;
    border: none;
}

.thesaurus-btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.thesaurus-btn-outline {
    background-color: transparent;
    color: var(--btn-primary);
    border: 1px solid var(--btn-primary);
}

.thesaurus-btn-outline:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
}

.thesaurus-btn-warning {
    background-color: #f59e0b;
    color: white;
    border: none;
}

.thesaurus-btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-2px);
}

/* Navigation */
.thesaurus-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.thesaurus-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--btn-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.thesaurus-back-link:hover {
    color: var(--btn-hover-primary);
    transform: translateX(-4px);
}

.thesaurus-back-link i {
    font-size: 0.9rem;
}

/* Admin Panel Styling */
.admin-options {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid #64748b;
}

.admin-options h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
}

/* Notification Styling */
.notification {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: fadeIn 0.3s ease;
}

.notification-success {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.notification-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.notification-danger {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.notification-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Filter Styles */
.filter-container {
    background-color: var(--card-wrapper);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 15px;
    position: sticky;
    top: 10%;
    z-index: 100;
}

.filter-heading {
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
}

.filter-options {
    display: flex;
    flex-direction: column;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filter-option input[type="radio"] {
    margin-right: 8px;
}

.filter-option label {
    color: var(--btn-text);
    font-weight: normal;
    margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .thesaurus-title {
        font-size: 2rem;
    }
    
    .terms-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .term-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .letter-link {
        min-width: 2.2rem;
        height: 2.2rem;
    }

    .letter-heading {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .thesaurus-container {
        padding: 1rem;
    }
    
    .terms-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .term-list {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .search-input, .search-button {
        padding: 0.75rem 1rem;
    }

    .load-more-button {
        width: 100%;
    }
}

[data-bs-theme="dark"] .letter-heading {
    color: white;
}

[data-bs-theme="dark"] .alphabet-nav {
    background: rgb(41 41 41);
}