/* styles\info.css */

.info {
    display: grid;
    row-gap: 1.25rem;
    font-family: 'Gilroy';
    margin-top: 50px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    background-color: transparent !important;
}

.info.animate-in {
    opacity: 1;
    transform: translateY(0);
}

@media (width <=90.06125rem) {
    .info {
        gap: 0.625rem;
        margin-top: 100px;
    }
}
@media (width <=47.99875rem) {
    .info {
        row-gap: 0.5rem;
        padding-inline: 1rem;
        padding-top: clamp(1.5rem, 4vw, 2.5rem);
        margin-top: 50px;
    }
}

.info__title {
    padding-bottom: 1.5625rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out 0.2s, transform 0.5s ease-out 0.2s;
}

.info.animate-in .info__title {
    opacity: 1;
    transform: translateY(0);
}

@media (width <=64rem) {
    .info__title {
        text-align: center;
    }
}

@media (max-width: 1024px) {
    .info {
        bottom: 42rem;
    }
}

.info__list {
    display: grid;
    gap: 1.25rem;
}

@media (width <=90.06125rem) {
    .info__list {
        gap: 0.625rem;
    }
}

@media (width <=63.99875rem) {
    .info__list {
        gap: 0.9375rem;
        justify-items: center;
    }
}

@media (width <=47.99875rem) {
    .info__list {
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}

.info__list--1 {
    grid-template-columns: 40% 37% 23%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
}

.info.animate-in .info__list--1 {
    opacity: 1;
    transform: translateY(0);
}

@media (width <=63.99875rem) {
    .info__list--1 {
        grid-template-columns: 1fr;
    }
}

.info__list--2 {
    grid-template-columns: 43% 21% 36%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-out 0.4s, transform 0.5s ease-out 0.4s;
}

.info.animate-in .info__list--2 {
    opacity: 1;
    transform: translateY(0);
}

@media (width <=63.99875rem) {
    .info__list--2 {
        grid-template-columns: 1fr;
    }
}

.card {
    height: 16.5625rem;
    padding: 1.875rem;
    display: flex;
    justify-content: space-between;
    -moz-column-gap: 1.875rem;
    column-gap: 1.875rem;
    overflow: hidden;
    background: linear-gradient(135deg, rgb(8, 24, 53) 0%, rgb(12, 50, 105) 100%);
    border-radius: 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: 
        all 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease-out,
        transform 0.4s ease-out;
    position: relative;
    cursor: pointer;
}

.info.animate-in .info__list--1 .card:nth-child(1) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.5s;
}

.info.animate-in .info__list--1 .card:nth-child(2) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.6s;
}

.info.animate-in .info__list--1 .card:nth-child(3) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.7s;
}

.info.animate-in .info__list--2 .card:nth-child(1) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.8s;
}

.info.animate-in .info__list--2 .card:nth-child(2) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.9s;
}

.info.animate-in .info__list--2 .card:nth-child(3) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 1s;
}

@media (width <=63.99875rem) {
    .card {
        width: calc(100vw - 10rem);
        max-width: calc(100vw - 2rem);
        margin: 0 auto;
    }
}

@media (width <=47.99875rem) {
    .card {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        height: 15rem;
        padding: 1.5rem;
    }
}

@media (width <=32rem) {
    .card {
        height: 14rem;
        padding: 1.25rem;
    }
}

.card__main {
    display: grid;
    row-gap: 1.875rem;
    position: relative;
    z-index: 2;
    max-width: 100%;
}

/* Для карточек с SVG - ограничиваем ширину контента */
.with-image {
    max-width: 65%; /* Ограничиваем ширину для карточек с SVG */
}

@media (width <=63.99875rem) {
    .info__list--1 .card:nth-child(1) .card__main,
    .info__list--1 .card:nth-child(2) .card__main,
    .info__list--2 .card:nth-child(1) .card__main {
        max-width: 100%; /* На мобилках убираем ограничение */
    }
}

.card__text {
    color: var(--color-light);
}

/* Увеличенный шрифт для заголовков карточек */
.card__title {
    font-size: 1.375rem; /* 22px вместо стандартного */
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

@media (width <=47.99875rem) {
    .card__title {
        font-size: 1.25rem; /* 20px на мобилках */
        line-height: 1.2;
    }
}

@media (width <=32rem) {
    .card__title {
        font-size: 1.125rem; /* 18px на маленьких экранах */
        line-height: 1.2;
    }
}

.card__description {
    color: var(--color-light);
    font-size: 0.875rem; /* 14px */
    line-height: 1.4;
    opacity: 0.8;
    margin-top: 0.5rem;
}

@media (width <=47.99875rem) {
    .card__description {
        font-size: 0.8125rem; /* 13px */
        line-height: 1.3;
    }
}

@media (width <=32rem) {
    .card__description {
        font-size: 0.75rem; /* 12px */
        line-height: 1.3;
    }
}

.card__price {
    text-wrap: nowrap;
    background: linear-gradient(var(--color-light), var(--color-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card__image {
    position: relative;
    top: 1.875rem;
    left: 8%;
}

.card__image--alt {
    position: relative;
    left: 6%;
}

/* Стили для SVG анимаций */
.card__bg-animation {
    position: absolute;
    bottom: -100px;
    right: -130px;
    width: 110%;
    height: 140%;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

/* ==================== BACKEND ANIMATION - VS Code редактор ==================== */

/* Начальные состояния */
.vscode-window {
    opacity: 0.8;
}

.code-line {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
}

.typing-cursor {
    opacity: 0;
}

.terminal-output {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
}

/* При hover - печатается код построчно */
.card:hover .vscode-window {
    animation: editorOpen 0.8s ease-out forwards;
}

.card:hover .code-line.line-1 {
    animation: typeCodeLine 1.5s ease-out 0.5s forwards;
}

.card:hover .code-line.line-2 {
    animation: typeCodeLine 1.2s ease-out 1.8s forwards;
}

.card:hover .code-line.line-4 {
    animation: typeCodeLine 1.8s ease-out 2.8s forwards;
}

.card:hover .code-line.line-5 {
    animation: typeCodeLine 1.3s ease-out 4.4s forwards;
}

.card:hover .code-line.line-6 {
    animation: typeCodeLine 1.6s ease-out 5.5s forwards;
}

.card:hover .code-line.line-7 {
    animation: typeCodeLine 1.4s ease-out 6.9s forwards;
}

.card:hover .code-line.line-9 {
    animation: typeCodeLine 1.7s ease-out 8.1s forwards;
}

.card:hover .code-line.line-10 {
    animation: typeCodeLine 1.5s ease-out 9.6s forwards;
}

.card:hover .typing-cursor {
    animation: cursorBlink 1s step-end infinite 0.5s;
}

.card:hover .terminal-output {
    animation: terminalRun 1s ease-out 11s forwards;
}

/* Keyframes для VS Code анимации */
@keyframes editorOpen {
    0% { 
        opacity: 0.8; 
        transform: scale(0.98); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes typeCodeLine {
    0% { 
        opacity: 0; 
        transform: scaleX(0); 
    }
    70% { 
        opacity: 1; 
        transform: scaleX(1); 
    }
    100% { 
        opacity: 0.9; 
        transform: scaleX(1); 
    }
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes terminalRun {
    0% { 
        opacity: 0; 
        transform: scaleX(0); 
    }
    100% { 
        opacity: 1; 
        transform: scaleX(1); 
    }
}

/* ==================== FRONTEND ANIMATIONS ==================== */

/* Начальное состояние */
.browser-window {
    opacity: 0.8;
}

.tab {
    fill: rgba(33,37,41,0.7);
}

.tab-1 {
    fill: rgba(52,58,64,0.9);
}

.page {
    opacity: 0;
    transform: translateX(20px);
}

.page-1 {
    opacity: 1;
    transform: translateX(0);
}

.page-element {
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
}

.loading-bar {
    width: 0;
}

/* При hover - имитация реального браузинга */
.card:hover .browser-window {
    animation: browserFocus 0.5s ease-out forwards;
}

/* Загрузка первой страницы */
.card:hover .page-1 .page-element {
    animation: pageElementLoad 0.4s ease-out forwards;
}

.card:hover .page-1 .page-element:nth-child(1) { animation-delay: 0.2s; } /* Header */
.card:hover .page-1 .page-element:nth-child(2) { animation-delay: 0.4s; } /* Text */
.card:hover .page-1 .page-element:nth-child(3) { animation-delay: 0.6s; } /* Text */
.card:hover .page-1 .page-element:nth-child(4) { animation-delay: 0.8s; } /* Text */
.card:hover .page-1 .page-element:nth-child(5) { animation-delay: 1.0s; } /* Image */
.card:hover .page-1 .page-element:nth-child(6) { animation-delay: 1.2s; } /* Footer */

.card:hover .loading-bar {
    animation: loadingBarProgress 1.5s ease-out 0.1s forwards;
}

/* Переключение на вторую вкладку */
.card:hover .tab-1 {
    animation: tabDeactivate 0.3s ease-out 3s forwards;
}

.card:hover .tab-2 {
    animation: tabActivate 0.3s ease-out 3s forwards;
}

.card:hover .page-1 {
    animation: pageSlideOut 0.5s ease-out 3.2s forwards;
}

.card:hover .page-2 {
    animation: pageSlideIn 0.5s ease-out 3.2s forwards;
}

/* Загрузка второй страницы */
.card:hover .page-2 .page-element {
    animation: pageElementLoad 0.4s ease-out forwards;
}

.card:hover .page-2 .page-element:nth-child(1) { animation-delay: 3.7s; }
.card:hover .page-2 .page-element:nth-child(2) { animation-delay: 3.9s; }
.card:hover .page-2 .page-element:nth-child(3) { animation-delay: 4.1s; }
.card:hover .page-2 .page-element:nth-child(4) { animation-delay: 4.3s; }
.card:hover .page-2 .page-element:nth-child(5) { animation-delay: 4.5s; }

/* Переключение на третью вкладку */
.card:hover .tab-2 {
    animation: tabDeactivate 0.3s ease-out 6s forwards;
}

.card:hover .tab-3 {
    animation: tabActivate 0.3s ease-out 6s forwards;
}

.card:hover .page-2 {
    animation: pageSlideOut 0.5s ease-out 6.2s forwards;
}

.card:hover .page-3 {
    animation: pageSlideIn 0.5s ease-out 6.2s forwards;
}

/* Загрузка третьей страницы */
.card:hover .page-3 .page-element {
    animation: pageElementLoad 0.4s ease-out forwards;
}

.card:hover .page-3 .page-element:nth-child(1) { animation-delay: 6.7s; }
.card:hover .page-3 .page-element:nth-child(2) { animation-delay: 6.9s; }
.card:hover .page-3 .page-element:nth-child(3) { animation-delay: 7.1s; }
.card:hover .page-3 .page-element:nth-child(4) { animation-delay: 7.3s; }
.card:hover .page-3 .page-element:nth-child(5) { animation-delay: 7.5s; }
.card:hover .page-3 .page-element:nth-child(6) { animation-delay: 7.7s; }

/* Keyframes для Frontend */
@keyframes browserFocus {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.005); }
}

@keyframes pageElementLoad {
    0% { 
        opacity: 0; 
        transform: scaleY(0); 
    }
    50% { 
        opacity: 0.8; 
        transform: scaleY(1.1); 
    }
    100% { 
        opacity: 1; 
        transform: scaleY(1); 
    }
}

@keyframes loadingBarProgress {
    0% { width: 0; }
    20% { width: 50px; }
    40% { width: 120px; }
    60% { width: 160px; }
    80% { width: 190px; }
    100% { width: 200px; }
}

@keyframes tabActivate {
    0% { fill: rgba(33,37,41,0.7); }
    100% { fill: rgba(52,58,64,0.9); }
}

@keyframes tabDeactivate {
    0% { fill: rgba(52,58,64,0.9); }
    100% { fill: rgba(33,37,41,0.7); }
}

@keyframes pageSlideOut {
    0% { 
        opacity: 1; 
        transform: translateX(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
}

@keyframes pageSlideIn {
    0% { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* ==================== TELEGRAM ANIMATIONS ==================== */

/* Начальное состояние */
.phone-frame {
    opacity: 0.8;
}

.chat-list-view {
    opacity: 1;
}

.chat-conversation-view {
    opacity: 0;
    transform: translateX(30px);
}

.message {
    opacity: 0;
    transform: translateX(20px) scale(0.8);
}

.typing-dot {
    opacity: 0;
    transform: scale(0);
}

/* При hover - имитация реального диалога с ботом */
.card:hover .phone-frame {
    animation: phoneWakeUp 0.5s ease-out forwards;
}

/* Открытие чата с ботом */
.card:hover .chat-list-view {
    animation: chatListSlideOut 0.6s ease-out 1s forwards;
}

.card:hover .chat-conversation-view {
    animation: chatSlideIn 0.6s ease-out 1s forwards;
}

/* Пользователь пишет первое сообщение */
.card:hover .message-1 {
    animation: userMessageSend 0.5s ease-out 2s forwards;
}

/* Бот показывает что печатает */
.card:hover .typing-dot {
    animation: typingIndicatorShow 1.5s ease-in-out 2.8s forwards;
}

.card:hover .typing-dot:nth-child(1) { animation-delay: 2.8s; }
.card:hover .typing-dot:nth-child(2) { animation-delay: 3.0s; }
.card:hover .typing-dot:nth-child(3) { animation-delay: 3.2s; }

/* Бот отвечает */
.card:hover .message-2 {
    animation: botMessageReceive 0.5s ease-out 4.5s forwards;
}

/* Пользователь пишет второе сообщение */
.card:hover .message-3 {
    animation: userMessageSend 0.5s ease-out 5.5s forwards;
}

/* Бот снова печатает и отвечает */
.card:hover .message-4 {
    animation: botMessageReceive 0.5s ease-out 7s forwards;
}

/* Пользователь пишет третье сообщение */
.card:hover .message-5 {
    animation: userMessageSend 0.5s ease-out 8s forwards;
}

/* Бот продолжает печатать */
.card:hover .typing-dot {
    animation: 
        typingIndicatorShow 1.5s ease-in-out 2.8s forwards,
        continuousTyping 1.5s ease-in-out 6.2s infinite;
}

/* Keyframes для Telegram */
@keyframes phoneWakeUp {
    0% { 
        opacity: 0.8; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.01); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes chatListSlideOut {
    0% { 
        opacity: 1; 
        transform: translateX(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-40px); 
    }
}

@keyframes chatSlideIn {
    0% { 
        opacity: 0; 
        transform: translateX(40px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes userMessageSend {
    0% { 
        opacity: 0; 
        transform: translateX(20px) scale(0.8); 
    }
    50% { 
        opacity: 1; 
        transform: translateX(-5px) scale(1.05); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

@keyframes botMessageReceive {
    0% { 
        opacity: 0; 
        transform: translateX(-20px) scale(0.8); 
    }
    50% { 
        opacity: 1; 
        transform: translateX(5px) scale(1.05); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

@keyframes typingIndicatorShow {
    0% { 
        opacity: 0; 
        transform: scale(0); 
    }
    30% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
    60% { 
        opacity: 0.8; 
        transform: scale(0.9); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes continuousTyping {
    0%, 60% { 
        transform: translateY(0) scale(1); 
        opacity: 0.7; 
    }
    30% { 
        transform: translateY(-3px) scale(1.3); 
        opacity: 1; 
    }
}

.rate_proj {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 50px auto 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out 0.6s, transform 0.5s ease-out 0.6s;
}

.info.animate-in .rate_proj {
    opacity: 1;
    transform: translateY(0);
}

.rate_proj p {
    font-weight: 600;
    font-size: 32px;
    color: #fff;
    line-height: 40px;
}

.rate_proj p span {
    background: linear-gradient(to right, #1461CC, #04DBD6);
    padding: 6px 24px;
    border-radius: 34px;
    font-size: 32px;
}

.rate_proj p:nth-child(1) {
    margin-left: -170px;
}

.rate_proj p:nth-child(2) {
    margin-right: -170px;
}

@media (max-width: 1024px) {
    .rate_proj p {
        font-weight: 500;
        font-size: 27px;
        line-height: 40px;
    }

    .rate_proj p span {
        padding: 5px 22px;
        border-radius: 34px;
        font-size: 27px;
    }

    .rate_proj p:nth-child(1) {
        margin-left: -0;
    }

    .rate_proj p:nth-child(2) {
        margin-right: -0;
    }
}

@media (max-width: 768px) {
    .rate_proj p {
        font-weight: 500;
        font-size: 22px;
        line-height: 30px;
    }

    .rate_proj p span {
        padding: 4px 18px;
        border-radius: 24px;
        font-size: 22px;
    }
}

@media (max-width: 410px) {
    .rate_proj p {
        font-weight: 400;
        font-size: 18px;
        line-height: 20px;
    }

    .rate_proj p span {
        padding: 3px 16px;
        border-radius: 20px;
        font-size: 18px;
    }
}

/* Responsive adjustments для SVG */
@media (width <= 63.99875rem) {
    .card__bg-animation {
        width: 100%;
        height: 130%;
        bottom: -80px;
        right: -100px;
        opacity: 0.4;
    }
}

@media (width <= 47.99875rem) {
    .card__bg-animation {
        width: 95%;
        height: 120%;
        bottom: -60px;
        right: -80px;
        opacity: 0.35;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .info,
    .info__title,
    .info__list--1,
    .info__list--2,
    .card,
    .rate_proj,
    .card__bg-animation,
    .card__bg-animation * {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
