:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f8f9fa;
    --text-color: #333;
    --sidebar-width: 300px;
    --header-height: 80px;
    --footer-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    min-height: 100vh;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-container {
    flex: 0 0 300px;
}

#search-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
}

main {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: calc(100vh - var(--header-height) - var(--footer-height));
}

.sidebar {
    background-color: white;
    border-right: 1px solid #e1e4e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.term-list-container {
    overflow-y: auto;
    flex: 1;
}

.term-list {
    list-style: none;
}

.term-list li {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
}

.term-list li:hover {
    background-color: #f0f7ff;
}

.term-list li.active {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    font-weight: 600;
}

.content {
    padding: 2rem;
    overflow-y: auto;
}

.term-details {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.term-title {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.term-description {
    line-height: 1.8;
}

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
        height: 200px;
    }

    header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    .search-container {
        width: 100%;
        margin-top: 1rem;
        flex: initial;
    }

    .content {
        padding: 1rem;
    }

    .term-details {
        padding: 1rem;
    }

    :root {
        --header-height: 120px;
    }
}

/* Letter navigation */
.letter-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    background-color: #f0f7ff;
    border-bottom: 1px solid #e1e4e8;
}

/* No results message */
.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    border-bottom: none !important;
    cursor: default !important;
}

.no-results:hover {
    background-color: transparent !important;
}

.letter-nav button {
    margin: 2px;
    width: 30px;
    height: 30px;
    border: none;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.letter-nav button:hover,
.letter-nav button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Highlight search results */
.highlight {
    background-color: yellow;
    font-weight: bold;
}