:root {
    --bg-dark: #1e1e1e;
    --bg-panel: #2a2a2a;
    --accent-primary: #ff9a3c;
    --accent-secondary: #ff6b6b;
    --text-primary: #f5f5f5;
    --text-secondary: #cccccc;
    --link-color: #ff9a3c;
    --link-hover: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

header {
    background-color: var(--bg-panel);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--accent-primary);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.title-container {
    flex: 1;
}

.language-switcher {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 34px;
    background-color: var(--bg-panel);
    border-radius: 17px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--accent-primary);
    overflow: hidden;
    text-decoration: none;
}

.toggle-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.3s;
    width: 50%;
    text-align: center;
}

.toggle-text:first-child {
    left: 0;
}

.toggle-text:last-child {
    right: 0;
}

.toggle-text.active {
    color: var(--accent-primary);
    font-weight: bold;
}

.toggle-handle {
    position: absolute;
    top: 2px;
    width: 30px;
    height: 30px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    transition: all 0.3s;
}

/* Позиция для английской версии (index.html) */
.language-switcher .toggle-handle {
    left: 2px;
}

/* Позиция для русской версии (index_ru.html) */
.language-switcher[href="index.html"] .toggle-handle {
    left: calc(100% - 32px);
}

.language-switcher:hover {
    background-color: var(--hover-color);
}



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

.grid-item {
    background-color: var(--bg-panel);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    /*justify-content: center;*/
    border: 1px solid rgba(255, 154, 60, 0.1);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 154, 60, 0.3);
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.grid-item h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.grid-item p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Стили для ссылок */
.links-container {
    margin: 1rem 0;
    width: 100%;
}

.content-link {
    display: block;
    color: var(--link-color);
    background-color: rgba(255, 154, 60, 0.1);
    padding: 0.7rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 154, 60, 0.2);
}

.content-link:hover {
    background-color: rgba(255, 107, 107, 0.2);
    color: var(--link-hover);
    border-color: rgba(255, 107, 107, 0.4);
    transform: translateX(5px);
}

.content-link i {
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

footer {
    background-color: var(--bg-panel);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 154, 60, 0.1);
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
