:root {
    --primary-color: #8b5cf6;
    --primary-hover: #a78bfa;
    --bg-dark: #0f0f0f;
    --card-dark: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #9ca3af;
    --border-dark: #27272a;
    --shadow-dark: rgba(139, 92, 246, 0.2);
    --error-color: #ef4444;
    --gradient-text: linear-gradient(120deg, #ffffff, #8b5cf6);
    --gradient-bg: linear-gradient(45deg, #8b5cf6, #1a1a1a);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: linear-gradient(45deg, var(--bg-dark) 0%, var(--card-dark) 100%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}

h1 {
    text-align: center;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: none;
}

h1 span {
    color: var(--primary-color);
}

h1 span.documentation {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.search-container {
    margin-bottom: 2rem;
    text-align: center;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, var(--bg-dark), var(--card-dark));
    color: var(--text-light);
}

#searchInput:focus {
    border-color: var(--primary-hover);
    box-shadow: 0 0 20px var(--shadow-dark);
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--card-dark);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-dark);
    border: 1px solid var(--border-dark);
}

.letter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 40px;
    border: 1px solid var(--border-dark);
}

.letter-btn:hover {
    background: var(--gradient-bg);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--shadow-dark);
}

.letter-btn.active {
    background: var(--gradient-bg);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--shadow-dark);
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.language-card {
    background: linear-gradient(145deg, var(--card-dark), var(--bg-dark));
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow-dark);
    transition: all 0.3s ease;
    border: 1px solid var(--border-dark);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.language-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

.language-card:hover {
    background: var(--gradient-bg);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.language-card:hover::before {
    width: 6px;
    background-color: var(--primary-hover);
}

.language-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-dark);
}

.language-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.language-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background-color: var(--bg-dark);
}

.language-link:hover {
    color: var(--text-light);
    background-color: var(--primary-color);
    text-decoration: none;
    transform: translateX(5px);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.letter-btn.active {
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .languages-grid {
        grid-template-columns: 1fr;
    }

    .letter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-bg);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.description {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    margin: 1rem 0;
}

.source-link {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    font-weight: 500;
}

.source-link:hover {
    text-decoration: underline;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    background: linear-gradient(45deg, var(--bg-dark) 0%, var(--card-dark) 100%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}

.language-card:hover .language-link {
    color: var(--text-light);
    background-color: var(--primary-color);
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-bg);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-dark);
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-dark);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-bg);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 50px; 
    height: 60px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-dark);
    z-index: 1000;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    align-items: center; 
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-dark);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.arrow {
    font-size: 1.5rem; 
    line-height: 1; 
}

.top-text {
    font-size: 0.9rem; 
    line-height: 1; 
}