/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5865F2;
    --primary-dark: #4752C4;
    --primary-light: #7983F5;
    --brand-experiment: #5865f2;
    --background-modifier-accent: rgba(79, 84, 92, 0.48);
    --background: #0F1117;
    --surface: #1A1D24;
    --surface-light: #242831;
    --text-primary: #FFFFFF;
    --text-secondary: #B9BBBE;
    --text-tertiary: #8E9297;
    --text-muted: #72767d;
    --background-tertiary: #202225;
    --border: #2F3136;
    --success: #3BA55D;
    --gradient: linear-gradient(135deg, #5865F2 0%, #EB459E 50%, #ED4245 100%);
    --gradient-text: linear-gradient(90deg, #5865F2, #EB459E);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(88, 101, 242, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo-link {
    text-decoration: none;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.logo-wrapper:hover {
    transform: translateY(-2px);
}

.logo-icon {
    width: 36px;
    height: 36px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
}

.login-btn:hover {
    background: var(--surface-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Герой секция */
.hero {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 500px;
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.1) 0%, transparent 100%);
    z-index: -1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-content {
    max-width: 520px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight {
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.3;
    z-index: -1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.cta-section {
    margin-bottom: 40px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.cta-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.cta-btn.primary {
    background: var(--gradient);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

.cta-btn.large {
    padding: 20px 40px;
    font-size: 1.25rem;
}

.cta-info {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.platforms {
    margin-top: 40px;
}

.platform-label {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.platform-icons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}

.platform-icon.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.platform-icon.disabled:hover {
    transform: none;
    background: var(--surface);
}

.platform-icon.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.platform-icon:hover:not(.active) {
    background: var(--surface-light);
    transform: translateY(-2px);
}

.coming-soon {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--surface-light);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Обновленные стили для предпросмотра чата */
.chat-preview {
    background: var(--background-secondary);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: var(--transition);
    width: 100%;
    max-width: 400px;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-preview:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.chat-preview .chat-header {
    border: none;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    padding: 8px 12px;
    min-height: 50px;
    width: 100%;
    border-bottom: 1px solid var(--background-tertiary);
    z-index: 1000;
}

.chat-preview .info-header-chat {
    display: flex;
    align-items: center;
    margin-right: auto;
    width: auto;
    padding: 4px 8px;
    height: 36px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    gap: 8px;
}

.chat-preview .avatarConversion {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.chat-preview .avatarConversion img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-preview .chat-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-preview .chat-info p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.chat-preview .chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
}

.chat-preview .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chat-preview .status-dot.online {
    background: var(--success);
}

.chat-preview .chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-preview .chat-action {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 4px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-preview .chat-action.select {
    background: var(--background-modifier-hover);
    color: var(--text-primary);
}

.chat-preview .chat-action img {
    width: 16px;
    height: 16px;
    filter: brightness(0.8);
}

/* Контейнер сообщений */
.chat-preview .messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    margin: 0;
    background: var(--background-primary);
}

.chat-preview .day-span {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 12px 0;
    color: var(--text-muted);
}

.chat-preview .day-span::before,
.chat-preview .day-span::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--background-modifier-accent);
}

.chat-preview .day-span-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 8px;
}

/* Сообщения */
.chat-preview .message {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
    padding: 4px;
    border-radius: 4px;
    position: relative;
}

.chat-preview .message:hover {
    background-color: var(--background-modifier-hover);
}

.chat-preview .message-header {
    display: grid;
    grid-template-columns: 32px 1fr;
    grid-template-areas:
        "avatar header-info"
        "avatar content";
    gap: 0 6px;
    align-items: start;
}

.chat-preview .avatar {
    width: 32px;
    height: 32px;
    grid-area: avatar;
    border-radius: 50%;
    outline: 2px solid var(--border);
}

.chat-preview .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-preview .message-header-info {
    grid-area: header-info;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 16px;
    margin-bottom: 2px;
}

.chat-preview .username {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.chat-preview .timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-preview .message-content {
    font-size: 14px;
    grid-area: content;
    line-height: 1.4;
    color: var(--text-normal);
    margin-top: 2px;
    justify-content: flex-start;
    display: flex;
}

/* Стикеры */
.chat-preview .images-grid.sticker {
    display: block;
    max-width: 100px;
    margin-top: 4px;
    overflow: visible;
}

.chat-preview .images-grid.sticker img {
    width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    border-radius: 8px;
}

/* Реакции */
.chat-preview .reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    margin-left: 38px;
}

.chat-preview .reaction {
    display: flex;
    align-items: center;
    background-color: var(--background-primary);
    border-radius: 10px;
    padding: 2px 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.chat-preview .reaction.my-reaction {
    background-color: var(--background-tertiary);
    border-color: var(--brand-experiment);
}

.chat-preview .reaction:hover {
    background-color: var(--background-tertiary);
}

.chat-preview .emoji-wrapper-reaction {
    width: 20px;
    height: 20px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.chat-preview .emoji-wrapper-reaction img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
}

.chat-preview .reaction-count {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 500;
}

.chat-preview .more-reactions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-modifier-accent);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
}

.chat-preview .more-reactions-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0.8);
}

/* Поле ввода */
.chat-preview .message-form {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--background-tertiary);
    border-top: 1px solid var(--border);
}

.chat-preview .input-container {
    display: flex;
    align-items: center;
    background-color: var(--background-secondary);
    border-radius: 8px;
    padding: 0 12px;
    min-height: 36px;
}

.chat-preview .message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-normal);
    padding: 8px 0;
    font-size: 13px;
    outline: none;
    font-family: "Segoe UI", sans-serif;
    min-height: 20px;
}

.chat-preview .message-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.chat-preview .attached-btn {
    background-color: var(--border);
    border: none;
    margin-right: 8px;
    border-radius: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.chat-preview .attached-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0.8);
}

.chat-preview .input-actions {
    display: flex;
    gap: 6px;
}

.chat-preview .input-action-button {
    background-color: transparent;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-preview .input-action-button img {
    width: 16px;
    height: 16px;
    filter: brightness(0.8);
}

/* Полоса прокрутки */
.chat-preview .messages-container::-webkit-scrollbar {
    width: 4px;
}

.chat-preview .messages-container::-webkit-scrollbar-track {
    background: var(--background-tertiary);
    border-radius: 4px;
}

.chat-preview .messages-container::-webkit-scrollbar-thumb {
    background: var(--background-accent);
    border-radius: 4px;
}

.chat-preview .messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--background-accent);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .chat-preview {
        transform: none;
        max-width: 100%;
        height: 450px;
    }

    .chat-preview:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .chat-preview {
        height: 400px;
    }

    .chat-preview .message-header {
        grid-template-columns: 28px 1fr;
    }

    .chat-preview .avatar {
        width: 28px;
        height: 28px;
    }

    .chat-preview .username {
        font-size: 12px;
    }

    .chat-preview .timestamp {
        font-size: 10px;
    }

    .chat-preview .message-content {
        font-size: 13px;
    }

    .chat-preview .reactions-container {
        margin-left: 34px;
    }
}

/* Возможности */
.features {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Исправленная сетка карточек 2x2 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

/* Призыв к действию */
.cta-section-final {
    padding: 80px 0;
}

.cta-card {
    background: var(--surface);
    padding: 64px;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0.05;
    z-index: 0;
}

.cta-card>* {
    position: relative;
    z-index: 1;
}

.cta-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-card p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-note {
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Футер */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand {
    grid-column: span 1;
}

.footer-brand .logo-wrapper {
    margin-bottom: 16px;
}

.footer-tagline {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface-light);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 12px;
    transition: var(--transition);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Анимации */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in-up 0.6s ease-out;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        margin: 0 auto;
    }

    .cta-info {
        justify-content: center;
    }

    .chat-preview {
        max-width: 500px;
        margin: 0 auto;
        transform: none;
    }

    .chat-preview:hover {
        transform: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .cta-card {
        padding: 40px 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .platform-icons {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 24px;
    }
}