/**
 * Glossar-spezifische Styles
 * Extrahiert aus glossar.php für bessere Wartbarkeit
 */

/* Glossar Item Styling */
.glossar-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 1.5rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    margin: 2rem 0;
}

.glossar-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.glossar-item h3 {
    margin-bottom: 0.75rem;
}

.glossar-item h3 a {
    color: var(--second-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.glossar-item h3 a:hover {
    color: var(--second-color-dark) !important;
}

/* Read More Link */
.read-more {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--second-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--second-color-dark) !important;
    padding-left: 5px;
}

.read-more i {
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* Alphabet Navigation */
.alphabet-nav {
    position: sticky;
    top: 100px;
    background: white;
    z-index: 10;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    margin-top: 2rem;
}

.alphabet-nav .letter-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: var(--second-color);
    color: white;
}

.alphabet-nav .letter-link:hover {
    background: var(--second-color-dark);
    transform: translateY(-2px);
}

.alphabet-nav .letter-disabled {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    border-radius: 5px;
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Search Section */
.glossar-search-container {
    max-width: 600px;
    margin: 0 auto;
}

.glossar-search {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--second-color);
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.glossar-search:focus {
    outline: none;
    border-color: var(--second-color-dark);
    box-shadow: 0 0 0 3px rgba(0, 90, 115, 0.1);
}

/* Letter Headings */
.glossar-letter-heading {
    color: var(--second-color);
    border-bottom: 2px solid var(--second-color);
    padding-bottom: 0.5rem;
    scroll-margin-top: 150px; /* Account for sticky nav */
}

.glossar-letter-heading:not(:first-child) {
    margin-top: 3rem;
}

/* Example Boxes */
.glossar-example {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-left: 3px solid var(--second-color);
    font-style: italic;
    border-radius: 0 5px 5px 0;
}

.glossar-example strong {
    color: var(--second-color);
}

/* Related Terms */
.glossar-related-terms {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.glossar-related-terms strong {
    color: var(--second-color);
}

/* No Results State */
.glossar-no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--second-color);
}

.glossar-no-results p:first-child {
    font-size: 1.2rem;
}

/* Content Container */
.glossar-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .glossar-item {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .alphabet-nav {
        position: static;
        padding: 0.5rem 0;
    }
    
    .alphabet-nav .letter-link,
    .alphabet-nav .letter-disabled {
        padding: 0.4rem 0.6rem;
        margin: 0.15rem;
        font-size: 0.9rem;
    }
    
    .glossar-search {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    .glossar-letter-heading {
        scroll-margin-top: 80px;
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .alphabet-nav,
    .glossar-search-container {
        display: none;
    }
    
    .glossar-item {
        box-shadow: none;
        border: 1px solid #ddd;
        margin: 1rem 0;
        break-inside: avoid;
    }
    
    .read-more {
        display: none;
    }
}

/* Search Highlights */
.search-highlight {
    background-color: #ffeb3b;
    color: inherit;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glossar-item {
        border: 2px solid #000;
        background: #fff;
    }
    
    .glossar-example {
        border-left-width: 4px;
        background-color: #f0f0f0;
    }
    
    .search-highlight {
        background-color: #ffff00;
        border: 1px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .glossar-item,
    .read-more,
    .read-more i,
    .alphabet-nav .letter-link {
        transition: none;
    }
    
    .glossar-item:hover {
        transform: none;
    }
    
    .read-more:hover {
        padding-left: 0;
    }
    
    .read-more:hover i {
        transform: none;
    }
}

/* ========================================
   SINGLE TERM PAGE STYLES
   ======================================== */

/* Term Navigation */
.term-navigation {
    background: #f8f9fa;
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.nav-terms {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-term {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    color: var(--second-color);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.nav-term:hover {
    background: var(--second-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,101,129,0.2);
}

.nav-term.current {
    background: var(--second-color);
    color: white;
    font-weight: 600;
}

.nav-separator {
    color: #ccc;
    font-size: 1.2rem;
}

/* Main Content */
.term-container {
    max-width: 800px;
    margin: 0 auto;
}

.term-header {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.term-header::before {
    content: attr(data-letter);
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 150px;
    font-weight: bold;
    color: rgba(0,101,129,0.05);
    z-index: 0;
}

.term-content {
    position: relative;
    z-index: 1;
}

.term-title {
    font-size: 2.5rem;
    color: var(--second-color-dark);
    margin-bottom: 0.5rem;
}

.term-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.term-definition {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 2rem;
}

.term-example {
    background: #f8f9fa;
    border-left: 4px solid var(--second-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.term-example h3 {
    color: var(--second-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.term-example code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Related Terms */
.related-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.related-section h3 {
    color: var(--second-color-dark);
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-card {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.related-card:hover {
    background: white;
    border-color: var(--second-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.related-card h4 {
    color: var(--second-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.related-card p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Navigation Footer */
.term-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--second-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--second-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: var(--second-color);
    color: white;
}

.nav-button.prev {
    padding-left: 1rem;
}

.nav-button.next {
    padding-right: 1rem;
}

/* Same Letter Links */
.same-letter-link {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    text-decoration: none;
    color: var(--second-color);
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.same-letter-link:hover {
    background: var(--second-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,101,129,0.2);
}

/* Letter Index */
.letter-index {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
}

.letter-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    text-decoration: none;
    color: var(--second-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.letter-link:hover,
.letter-link.active {
    background: var(--second-color);
    color: white;
    transform: scale(1.1);
}

/* Mobile Responsive for Term Page */
@media (max-width: 768px) {
    .term-title {
        font-size: 2rem;
    }
    
    .term-header {
        padding: 2rem 1.5rem;
    }
    
    .nav-terms {
        font-size: 0.75rem;
    }
    
    .nav-term {
        padding: 0.4rem 0.8rem;
    }
    
    .term-nav-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .term-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}