/* public/assets/css/app.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}

/* Основной контейнер */
.app-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Карточки */
.card {
    background: white;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 28px;
}

.card-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 14px;
    opacity: 0.9;
}

.card-content {
    padding: 24px 28px;
}

/* Конструктор */
.constructor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 700px) {
    .constructor-grid {
        grid-template-columns: 1fr;
    }
}

.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a1a1a;
}

.setting-name {
    font-size: 14px;
}

.setting-value {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Базовые настройки */
.basic-settings {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.basic-field {
    flex: 1;
    min-width: 120px;
}

.basic-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.basic-field input,
.basic-field select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 14px;
    font-family: inherit;
    background: #fafbfc;
}

.basic-field input:focus,
.basic-field select:focus {
    outline: none;
    border-color: #667eea;
}

/* Gender toggle */
.gender-toggle {
    display: flex;
    gap: 12px;
    background: #f1f5f9;
    border-radius: 100px;
    padding: 4px;
}

.gender-option {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.gender-option.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #667eea;
}

/* Кнопки */
.find-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
}

.find-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px -10px rgba(102, 126, 234, 0.4);
}

.find-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Чат */
.chat-messages {
    height: 98%;
    overflow-y: auto;
    padding: 20px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.user-message .message-icon {
    background: #667eea;
    color: white;
}

.message-content {
    max-width: 70%;
    background: white;
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background: #667eea;
    color: white;
}

.message-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.7;
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.5;
    text-align: right;
}

/* Инпут чата */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    background: #fafbfc;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Индикатор печатания */
.typing-indicator {
    display: flex;
    justify-content: flex-start;
}

.typing-dots {
    background: white;
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    gap: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingPulse 1.2s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.empty-chat {
    text-align: center;
    color: #94a3b8;
    padding: 40px;
}

.hidden {
    display: none;
}

/* Ошибки */
.error-message {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 16px;
    padding: 12px 16px;
    margin: 0 20px 20px 20px;
    color: #ef4444;
    font-size: 14px;
}

/* Стили для кнопки воспроизведения голоса */
.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.voice-play-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
    opacity: 0.7;
}

.voice-play-btn:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.user-message .voice-play-btn {
    color: white;
}

.user-message .voice-play-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Анимация воспроизведения */
.voice-play-btn.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* Стили для изображений в чате */
.message-image {
    margin-top: 12px;
    position: relative;
    display: inline-block;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
}

.generated-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.generated-image:hover {
    transform: scale(1.02);
}

.image-view-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.message-image:hover .image-view-btn {
    opacity: 1;
}

/* Модальное окно для изображений */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    cursor: pointer;
}

/* Предложение премиума */
.premium-offer {
    display: flex;
    justify-content: center;
    padding: 20px;
    animation: fadeInUp 0.4s ease;
}

.premium-offer-card {
    background: linear-gradient(135deg, #1a1a3a 0%, #0a0a2a 100%);
    border-radius: 32px;
    padding: 32px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.premium-offer-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.premium-offer-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #ffd700;
}

.premium-offer-card p {
    font-size: 14px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.premium-offer-price {
    font-size: 18px;
    margin: 16px 0 !important;
}

.premium-offer-price strong {
    color: #ffd700;
    font-size: 24px;
}

.premium-offer-features {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.premium-offer-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.premium-offer-features li::before {
    content: "✓";
    color: #22c55e;
    font-weight: bold;
}

.premium-offer-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.premium-offer-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.premium-offer-reset {
    display: block;
    margin-top: 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-offer-card {
    background: linear-gradient(135deg, #1a1a3a 0%, #0a0a2a 100%);
    border-radius: 20px;
    padding: 16px 20px;
    color: white;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.premium-offer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.premium-offer-text {
    flex: 1;
}

.premium-offer-text h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #ffd700;
}

.premium-offer-reset {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.premium-offer-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.premium-offer-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.payment-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-left: 6px;
    transition: transform 0.2s;
}

.payment-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Адаптив для мобильных */
@media (max-width: 500px) {
    .premium-offer-content {
        flex-direction: column;
        text-align: center;
    }

    .premium-offer-btn {
        white-space: normal;
        width: 100%;
    }
}