/* Стили для страницы чата (index.php) */

/* ===== ГЛАВНАЯ ОБЛАСТЬ ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== ОБЛАСТЬ ЧАТА ===== */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

/* Пустое состояние чата */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-empty h2 {
    font-size: 24px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-pink), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.chat-empty p {
    font-size: 11px;
    color: var(--color-gray);
    line-height: 2;
    max-width: 700px;
    text-align: center;
}

/* Pixel particles фон - отключено */
.pixel-particles {
    display: none;
}

.particle {
    display: none;
}

/* ===== СООБЩЕНИЯ ЧАТА ===== */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--color-purple), var(--color-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid var(--color-cyan);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--color-blue), var(--color-cyan));
}

.message-content {
    flex: 1;
    background: rgba(31, 41, 55, 0.6);
    padding: 15px 20px;
    border-left: 4px solid var(--color-purple);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.message.user .message-content {
    border-left: none;
    border-right: 4px solid var(--color-cyan);
}

/* ===== ОБЛАСТЬ ВВОДА ===== */
.chat-input-area {
    padding: 20px 30px;
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(10px);
    border-top: 4px solid var(--color-pink);
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.chat-input {
    flex: 1;
    padding: 15px 20px;
    background: var(--color-dark-input);
    color: var(--color-light);
    border: 3px solid var(--color-purple);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 56px;
    max-height: 150px;
    transition: all 0.3s ease;
    line-height: 1.5;
    overflow-y: hidden;
}

.chat-input.has-scroll {
    overflow-y: auto;
}

/* Стилизация скроллбара для поля ввода */
.chat-input::-webkit-scrollbar {
    width: 8px;
}

.chat-input::-webkit-scrollbar-track {
    background: var(--color-dark);
    border-left: 2px solid var(--color-purple);
}

.chat-input::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-purple), var(--color-pink));
    border-radius: 0;
}

.chat-input::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-cyan), var(--color-blue));
}

.chat-input:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.chat-input::placeholder {
    color: var(--color-gray);
    opacity: 0.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* Кнопка прикрепления файла */
.attach-button {
    padding: 0;
    width: 56px;
    height: 56px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--color-purple);
    border: 3px solid var(--color-purple);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.attach-icon {
    width: 22px;
    height: 22px;
    stroke: var(--color-purple);
    transition: stroke 0.3s ease;
}

.attach-button:hover {
    background: rgba(139, 92, 246, 0.4);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.attach-button:hover .attach-icon {
    stroke: var(--color-cyan);
}

.attach-button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.send-button {
    padding: 0 28px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-pink), var(--color-purple));
    color: white;
    border: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.send-button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* Опции под полем ввода */
.input-options {
    max-width: 1200px;
    margin: 15px auto 0;
    padding-top: 15px;
    border-top: 2px solid rgba(139, 92, 246, 0.3);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.model-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.model-selector label {
    font-size: 9px;
    color: var(--color-gray);
    white-space: nowrap;
}

.model-selector select {
    padding: 8px 12px;
    background: var(--color-dark-input);
    color: var(--color-light);
    border: 2px solid var(--color-purple);
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    cursor: pointer;
    outline: none;
    flex: 0 0 auto;
    min-width: 200px;
}

.model-selector select:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* ===== АДАПТИВНОСТЬ (ПЛАНШЕТЫ) ===== */
@media (max-width: 1024px) {
    .chat-area {
        padding: 20px;
    }
    
    .chat-input-area {
        padding: 15px 20px;
    }
    
    .chat-empty h2 {
        font-size: 20px;
    }
    
    .chat-empty p {
        font-size: 10px;
    }
}

/* ===== АДАПТИВНОСТЬ (МОБИЛЬНЫЕ) ===== */
@media (max-width: 768px) {
    .chat-area {
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 15px;
    }

    .input-container {
        gap: 8px;
    }

    .attach-button {
        width: 46px;
        height: 46px;
    }

    .attach-icon {
        width: 18px;
        height: 18px;
    }
    
    .chat-input {
        font-size: 14px;
        min-height: 46px;
        padding: 12px 15px;
    }

    .send-button {
        font-size: 8px;
        height: 46px;
        padding: 0 14px;
    }

    .input-options {
        padding-top: 10px;
        margin-top: 10px;
        justify-content: flex-start;
    }

    .model-selector {
        width: 100%;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        margin-left: 0;
    }
    
    .model-selector label {
        font-size: 8px;
        white-space: nowrap;
    }

    .model-selector select {
        flex: 1;
        min-width: auto;
        font-size: 7px;
        padding: 10px;
    }

    .chat-empty {
        padding: 20px;
    }

    .chat-empty h2 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .chat-empty p {
        font-size: 9px;
        line-height: 1.8;
    }

    .message {
        gap: 10px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .message-content {
        font-size: 13px;
        padding: 12px 15px;
    }
}

/* ===== АДАПТИВНОСТЬ (МАЛЕНЬКИЕ МОБИЛЬНЫЕ) ===== */
@media (max-width: 480px) {
    .chat-area {
        padding: 10px;
    }
    
    .chat-input-area {
        padding: 10px;
    }

    .input-container {
        gap: 6px;
    }

    .attach-button {
        width: 42px;
        height: 42px;
    }

    .attach-icon {
        width: 16px;
        height: 16px;
    }
    
    .chat-input {
        font-size: 14px;
        min-height: 42px;
        padding: 10px 12px;
    }

    .send-button {
        font-size: 7px;
        height: 42px;
        padding: 0 12px;
    }

    .model-selector label {
        font-size: 7px;
    }

    .model-selector select {
        font-size: 6px;
        padding: 8px;
    }

    .chat-empty h2 {
        font-size: 14px;
    }

    .chat-empty p {
        font-size: 8px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .message-content {
        font-size: 12px;
        padding: 10px 12px;
    }
}
