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

:root {
    --primary: #1e40af;
    --light: #f0f9ff;
    --border: #e2e8f0;
    --text: #1e293b;
    --gray: #64748b;
    --hover: #dbeafe;
    --transition: all 0.15s ease;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background-color: #f8fafc;
    padding: 0;
}

.site-content {
    flex: 1;
    width: 100%;
}

.content-container {
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: block;
    /*margin-bottom: 2rem;*/
    padding: 0.2rem 1rem;
    background: white;
    box-shadow: 0 0 25px -10px var(--primary);
}

header h1 {
    text-align: end;
}

.header-center {
    justify-content: space-between;
    margin: 0 auto;
}

.nav {
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.flex-row-container {
    display: flex;
    flex-flow: row;
    align-items: center;
}

.nav-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: underline;
    color: var(--primary);
    margin-right: 1rem;
    flex-basis: 110px;
    margin-top: 1rem;
}

.nav-btn:hover {
    background: var(--hover);
    border-color: var(--primary);
}

h1 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.subtitle {
    color: var(--gray);
    font-size: 1.05rem;
    text-align: end;
}

.logo {
    height: 3rem;
    padding: 0.15rem;
}

.index {
    display: flex;
    gap: 2rem;
}

.alphabet-nav {
    flex-shrink: 0;
    width: 80px;
    display: none;
}

.alphabet-list {
    list-style: none;
    position: sticky;
    top: 20px;
}

.alphabet-item {
    margin-bottom: 0.5rem;
}

.alphabet-link {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.alphabet-link:hover,
.alphabet-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.container {
    flex: 1;
}

.letter-section {
    margin-bottom: 2rem;
}

.letter-title {
    font-size: 1.4rem;
    color: var(--primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1rem;
}

.list {
    list-style: none;
    display: grid;
    gap: 0.25rem;
}

.item {
    background: white;
    border-radius: 8px;
    padding: 0;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item:hover {
    border-color: var(--primary);
    background: var(--hover);
    transform: translateX(4px);
}

.link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    flex: 1;
    padding: 0.75rem 1rem;
    height: 100%;
}

.inline-link {
    text-decoration: underline;
    color: var(--primary);
    font-weight: 500;
}

.status {
    height: fit-content;
    font-size: 0.8rem;
    margin-left: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--light);
    color: var(--primary);
}

.status-abolished {
    background: #fef2f2;
    color: #b91c1c;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: var(--gray);
}

.site-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--gray);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding-bottom: 2px;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: var(--transition);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copyright {
    text-align: center;
    line-height: 1.4;
}

/* Адаптивность */
@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer-copyright {
        text-align: left;
    }
}

#cookie-banner {
    height: 5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #ddd;
    z-index: 9999;
    display: none;
    flex-direction: row;
    justify-items: center;
    align-items: center;
    justify-content: center;
}

.email {
    cursor: pointer;
}

.email .inline-link {
    text-decoration: dashed;
}

.popup {
    display: none;
}

.popup.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition:
            opacity 0.3s ease,
            transform 0.3s ease;
}

.popup.animating-in {
    opacity: 0;
    transform: translateY(-10px); /* лёгкий выезд сверху */
}

/* Popup notification styles */
#copyPopup {
    position: fixed;
    top: calc(67px + 1rem);
    right: -300px; /* Спрятано за правой границей */
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transition:
            right 0.3s ease-out,
            opacity 0.3s ease-out;
    z-index: 10000;
    white-space: nowrap;
}

#copyPopup.show {
    right: 20px; /* Появляется на 20px от правого края */
    opacity: 1;
}

@media (min-width: 900px) {
    .alphabet-nav {
        display: block;
    }

    .list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .list {
        grid-template-columns: repeat(3, 1fr);
    }
}