/* Сброс отступов для контейнера */
.text .container {
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Заголовок */
.text .header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 15px;
    background: linear-gradient(45deg, #2d1b69 0%, #1a0b3d 100%);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    box-sizing: border-box;
}

.text .header h1 {
    font-size: 2.2em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 8px;
    font-weight: bold;
}

.text .header p {
    font-size: 1.1em;
    color: #c0c0c0;
    font-style: italic;
}

/* Введение */
.text .intro-text {
    text-align: center;
    margin: 25px 0;
    padding: 20px 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    width: 100%;
    box-sizing: border-box;
}

.text .intro-text h2 {
    color: #ffd700;
    font-size: 1.6em;
    margin-bottom: 12px;
}

.text .intro-text p {
    font-size: 1em;
    line-height: 1.5;
    color: #e0e0e0;
}

/* Заголовки разделов */
.text .section-title {
    text-align: center;
    margin: 35px 0 20px;
    font-size: 1.8em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Гриды */
.text .grid-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
}

.text .grid-double {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
    width: 100%;
}

.text .grid-triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
    width: 100%;
}

.text .grid-quad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
    width: 100%;
}

/* Карточки */
.text .card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(147, 112, 219, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.text .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s;
}

.text .card:hover::before {
    left: 100%;
}

.text .card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: #ffd700;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.text .card-icon {
    font-size: 2.2em;
    text-align: center;
    margin-bottom: 12px;
    color: #ffd700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.text .card h3 {
    font-size: 1.2em;
    color: #ffd700;
    margin-bottom: 8px;
    text-align: center;
    font-weight: bold;
    line-height: 1.2;
}

.text .card p {
    color: #c0c0c0;
    line-height: 1.4;
    text-align: center;
    font-size: 0.95em;
    margin: 0;
}

/* Большие карточки */
.text .large-card {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2) 0%, rgba(75, 0, 130, 0.2) 100%);
    border: 3px solid rgba(138, 43, 226, 0.5);
    padding: 25px;
}

.text .large-card .card-icon {
    font-size: 2.8em;
}

.text .large-card h3 {
    font-size: 1.6em;
}

.text .large-card p {
    font-size: 1.1em;
}

/* Текстовые секции */
.text .text-section {
    margin: 35px 0;
    padding: 20px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 10px;
    border-left: 4px solid #8a2be2;
    width: 100%;
    box-sizing: border-box;
}

.text .text-section h3 {
    color: #ffd700;
    font-size: 1.4em;
    margin-bottom: 12px;
}

.text .text-section p {
    line-height: 1.6;
    font-size: 1em;
    color: #e0e0e0;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 900px) {
    .text .grid-quad {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .text .grid-double,
    .text .grid-triple,
    .text .grid-quad {
        grid-template-columns: 1fr;
    }
    
    .text .header h1 {
        font-size: 1.8em;
    }
    
    .text .header p {
        font-size: 1em;
    }
    
    .text .section-title {
        font-size: 1.5em;
    }
    
    .text .card {
        padding: 15px;
    }
    
    .text .large-card {
        padding: 20px;
    }
    
    .text .large-card .card-icon {
        font-size: 2.4em;
    }
    
    .text .large-card h3 {
        font-size: 1.4em;
    }
    
    .text .large-card p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .text .header {
        padding: 15px 10px;
    }
    
    .text .intro-text {
        padding: 15px 10px;
    }
    
    .text .text-section {
        padding: 15px;
    }
    
    .text .card {
        padding: 12px;
    }
    
    .text .card h3 {
        font-size: 1.1em;
    }
    
    .text .card p {
        font-size: 0.9em;
    }
    
    .text .card-icon {
        font-size: 2em;
    }
}

/* Анимации */
.text .animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.text .animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Дополнительные стили для интеграции */
.text .container * {
    box-sizing: border-box;
}

/* Убираем внешние отступы у всех элементов в контейнере */
.text .container > * {
    max-width: 100%;
}

/* Обеспечиваем правильное поведение изображений */
.text .card img {
    max-width: 100%;
    height: auto;
}

/* Для очень маленьких экранов */
@media (max-width: 320px) {
    .text .grid-single,
    .text .grid-double,
    .text .grid-triple,
    .text .grid-quad {
        gap: 10px;
    }
    
    .text .card {
        padding: 10px;
    }
    
    .text .header h1 {
        font-size: 1.6em;
    }
    
    .text .section-title {
        font-size: 1.3em;
    }
}