: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 !important;
    font-weight: 600 !important;
    color: var(--btn-text) !important;
    margin-bottom: 0.75rem !important;
}

.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;
}

/* Terms List - Fixed font sizes */
.term-list {
    display: flex;
    flex-direction: column;
}

.term-item {
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
    font-size: 1rem !important; /* Fixed font size */
}

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

.term-link {
    display: block !important;
    color: var(--btn-text) !important;
    text-decoration: none !important;
    font-size: 1rem !important; /* Fixed font size - smaller than subtitle */
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
}

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

.term-unlink {
    color: var(--btn-text) !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 1rem !important; /* Fixed font size */
}

/* Term Details Styling */
.term-detail-card {
    background-color: var(--card-wrapper);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.term-section {
    margin-bottom: 1.5rem;
}

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

.term-description {
    background-color: var(--main-sidebar);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--btn-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--menu-list);
}

/* Subject Styling */
.subject-heading {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.subject-description {
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--btn-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #334155;
}

/* 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;
}

/* Metadata Section */
.metadata-section {
    background: var(--main-sidebar);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    border-left: 4px solid #94a3b8;
}

.metadata-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--menu-list) !important;
    margin-bottom: 0.75rem;
}

.metadata-section p {
    margin-bottom: 0.5rem;
    color: var(--menu-list) !important;
}

.metadata-section strong {
    color: var(--menu-list) !important;
    font-weight: 500;
}

/* 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;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .thesaurus-title {
        font-size: 2rem;
    }
    
    .thesaurus-subtitle {
        font-size: 1.5rem !important; /* Still larger than term-link */
    }
    
    .term-link, .term-item, .term-unlink {
        font-size: 0.9rem !important; /* Smaller but readable */
    }
}

@media (max-width: 576px) {
    .thesaurus-container {
        padding: 1rem;
    }
    
    .search-input, .search-button {
        padding: 0.75rem 1rem;
    }
    
    .thesaurus-subtitle {
        font-size: 1.3rem !important; /* Still larger than term-link */
    }
    
    .term-link, .term-item, .term-unlink {
        font-size: 0.85rem !important; /* Smaller for mobile */
    }
}

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

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