/* 3Commas Page Styles - Chat Interface */

/* Body background */
body {
    background: #F0F3F5;
}

/* Main Content Styles */
.main-content {
    min-height: 100vh;
    padding-top: 168px;
    padding-bottom: 104px;
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Chat Container Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 600px;
    margin: 0 auto;
}

/* Web Version Styles */
@media (min-width: 768px) {
    .chat-container {
        width: 600px;
        gap: 48px;
    }
}

/* Mobile Version Styles */
@media (max-width: 767px) {
    .main-content {
        padding-top: 0;
        padding-left: 0;
        padding-right: 0;
    }
    
    .chat-container {
        width: 100%;
        min-width: 320px;
        gap: 24px;
        padding: 16px;
    }
}

/* 1. Сообщение от автора (Title) */
.chat-message-author {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: auto;
}

/* Первое сообщение с дополнительным отступом */
.chat-container .chat-message-author.chat-message-first {
    padding-top: 48px !important;
}

/* Мобильная версия для первого сообщения */
@media (max-width: 767px) {
    .chat-container .chat-message-author.chat-message-first {
        padding-top: 80px !important;
    }
}

.chat-message-author .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 32px;
    gap: 12px;
    width: auto;
    min-width: 100px;
    max-width: 488px;
    height: auto;
    background: #FFFFFF;
    border-radius: 32px 32px 32px 6px;
}

.chat-message-author .chat-text {
    width: auto;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.4;
    color: #000000;
}

/* Mobile version for author message */
@media (max-width: 767px) {
    .chat-message-author {
        align-items: flex-start;
        justify-content: center;
    }
    
    .chat-message-author .chat-block {
        padding: 12px 18px;
        gap: 12px;
        max-width: 320px;
        border-radius: 20px 20px 20px 4px;
    }
    
    .chat-message-author .chat-text {
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
}

/* 2. Контент автора (Content) */
.chat-content-author {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: auto;
}

.chat-content-author .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 32px;
    gap: 12px;
    width: auto;
    min-width: 100px;
    max-width: 488px;
    height: auto;
    background: #FFFFFF;
    border-radius: 32px 32px 32px 6px;
}

.chat-content-author .chat-text {
    width: auto;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.4;
    color: #000000;
}

/* Mobile version for content author */
@media (max-width: 767px) {
    .chat-content-author {
        align-items: flex-start;
        justify-content: center;
    }
    
    .chat-content-author .chat-block {
        padding: 12px 18px;
        gap: 12px;
        max-width: 320px;
        border-radius: 20px 20px 20px 4px;
    }
    
    .chat-content-author .chat-text {
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
}

/* 3. Список автора (Title+Content) */
.chat-list-author {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: auto;
}

.chat-list-author .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 32px;
    gap: 4px;
    width: 488px;
    min-width: 100px;
    max-width: 488px;
    height: auto;
    background: #FFFFFF;
    border-radius: 32px 32px 32px 6px;
}

.chat-list-author .chat-title {
    width: 424px;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.4;
    color: #000000;
}

.chat-list-author .chat-text {
    width: 424px;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.4;
    color: #333333;
}

/* Mobile version for list author */
@media (max-width: 767px) {
    .chat-list-author {
        align-items: flex-start;
        justify-content: center;
    }
    
    .chat-list-author .chat-block {
        padding: 12px 18px;
        gap: 4px;
        width: 488px;
        max-width: 320px;
        border-radius: 20px 20px 20px 4px;
    }
    
    .chat-list-author .chat-title {
        width: 284px;
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
    
    .chat-list-author .chat-text {
        width: 284px;
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
}

/* 4. Сообщение от репортера (Chat) */
.chat-message-reporter {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0px;
    gap: 8px;
    width: 100%;
    height: auto;
}

.chat-message-reporter .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 32px;
    gap: 12px;
    width: auto;
    min-width: 100px;
    max-width: 488px;
    height: auto;
    background: #333333;
    border-radius: 32px 6px 32px 32px;
}

.chat-message-reporter .chat-text {
    width: auto;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.4;
    color: #FFFFFF;
}

/* Mobile version for reporter message */
@media (max-width: 767px) {
    .chat-message-reporter {
        align-items: flex-end;
        justify-content: center;
    }
    
    .chat-message-reporter .chat-block {
        padding: 12px 18px;
        gap: 12px;
        width: 320px;
        min-width: 40px;
        max-width: 320px;
        border-radius: 20px 4px 20px 20px;
    }
    
    .chat-message-reporter .chat-text {
        width: 284px;
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
}

/* 5. Картинка (IMG-1) */
.chat-image {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: auto;
}

.chat-image .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 24px;
    width: 488px;
    min-width: 280px;
    max-width: 488px;
    height: auto;
    background: #FFFFFF;
    border-radius: 42px 42px 42px 6px;
}

.chat-image .chat-img {
    box-sizing: border-box;
    width: 440px;
    height: auto;
    border-radius: 16px;
}

/* Mobile version for image */
@media (max-width: 767px) {
    .chat-image .chat-block {
        padding: 12px;
        gap: 24px;
        width: 320px;
        min-width: 280px;
        max-width: 320px;
        border-radius: 24px 24px 24px 4px;
    }
    
    .chat-image .chat-img {
        width: 296px;
        height: auto;
    }
}

/* 6. Контент + Кнопка */
.chat-content-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 100%;
    height: auto;
}

.chat-content-button .chat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    gap: 32px;
    width: auto;
    min-width: 100px;
    max-width: 488px;
    height: auto;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #FF00FF 0%, #0079FF 100%) border-box;
    border: 3px solid transparent;
    border-radius: 36px 36px 36px 6px;
}

.chat-content-button .chat-text {
    width: auto;
    height: auto;
    font-family: 'Inria Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.4;
    color: #000000;
}

.chat-content-button .chat-button {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 16px 32px;
    gap: 8px;
    width: auto;
    height: 56px;
    background: linear-gradient(90deg, #FF00FF 0%, #0079FF 100%);
    border-radius: 28px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.chat-content-button .chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    animation: shimmer 5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    10% { left: 100%; }
    100% { left: 100%; }
}

.chat-content-button .chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 121, 255, 0.3);
}

.chat-content-button .chat-button-text {
    width: auto;
    height: 24px;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    color: #FFFFFF;
    text-align: center;
}

.chat-buttons-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.chat-text-button {
    width: auto;
    height: 24px;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    text-align: center;
    background: linear-gradient(90deg, #FF00FF 0%, #0079FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding-left: 8px;
}

.chat-text-button:hover {
    opacity: 0.7;
}

/* Mobile version for content+button */
@media (max-width: 767px) {
    .chat-content-button .chat-block {
        padding: 16px;
        gap: 16px;
        width: 100%;
        min-width: 100px;
        max-width: 100%;
        background: linear-gradient(white, white) padding-box,
                    linear-gradient(90deg, #FF00FF 0%, #0079FF 100%) border-box;
        border: 2px solid transparent;
        border-radius: 24px 24px 24px 4px;
    }
    
    .chat-content-button .chat-text {
        width: 100%;
        font-size: 18px;
        line-height: 1.3;
        height: auto;
    }
    
    .chat-content-button .chat-button {
        width: auto;
        height: 44px;
    }
    
    .chat-content-button .chat-button-text {
        font-size: 14px;
    }
    
    .chat-buttons-container {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }
    
    .chat-text-button {
        font-size: 14px;
    }
}

/* Scroll Animation Styles */
.chat-message-author,
.chat-content-author,
.chat-list-author,
.chat-message-reporter,
.chat-image,
.chat-content-button {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.chat-message-author.animate,
.chat-content-author.animate,
.chat-list-author.animate,
.chat-message-reporter.animate,
.chat-image.animate,
.chat-content-button.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 16px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.chat-img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-img:hover {
    transform: scale(1.02);
}