* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 250px);
}

/* Glossary Container */

.glossary-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Filter Panel */
.filter-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
}

.filter-panel h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f5f7fa;
}

/* Active Filters */
.active-filters {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.active-filters h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #667eea;
}

.active-filters ul {
    list-style: none;
}

.active-filters li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

/* Results Panel */
.results-panel {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.results-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.results-count {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Glossary Grid */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Term Card */
.term-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.term-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.term-title {
    font-size: 1.4rem;
    color: #333;
    flex: 1;
}

.term-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.term-title a:hover {
    color: #667eea;
}

.category-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.category-badge.large {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.term-definition {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f0f4ff;
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: #667eea;
    color: white;
}

.tag.large {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.3s;
}

.read-more:hover {
    transform: translateX(5px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results h3 {
    font-size: 2rem;
    color: #666;
    margin-bottom: 1rem;
}

.no-results p {
    color: #999;
    margin-bottom: 2rem;
}

/* Term Detail Page */
.term-detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #764ba2;
}

.term-detail {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.detail-header h1 {
    font-size: 3rem;
    color: #333;
    margin-bottom: 1rem;
}

.detail-content {
    margin-bottom: 2rem;
}

.detail-content h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.definition-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
}

.detail-tags {
    margin-bottom: 2rem;
}

.detail-tags h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.detail-actions {
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 968px) {
    .glossary-container {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: static;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .detail-header h1 {
        font-size: 2rem;
    }
}