/* ================================================
   ULTRA-MODERN ABOUT SECTION 2025
   Glassmorphism + Animated Timeline + Bento Grid
   ================================================ */

/* About Section Container */
.about-modern-2025 {
    position: relative;
    padding: 4rem 0; /* 64px = 1.7cm */
    overflow: hidden;
    background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
}

/* Background Gradient Effect */
.about-bg-gradient {
    position: absolute;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 150%;
    background: radial-gradient(
        ellipse at center,
        rgba(59, 130, 246, 0.1) 0%,
        transparent 70%
    );
    animation: pulse-glow 8s ease-in-out infinite;
    pointer-events: none;
}

.about-mesh-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
    opacity: 0.5;
    pointer-events: none;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Modern Section Title */
.section-title-modern {
    /* Base styles come from .section-heading and .section-heading-gradient */
}

.gradient-text-modern {
    background: linear-gradient(135deg, #FFFFFF 0%, #3B82F6 50%, #A855F7 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

/* AI Chat Interface */
.ai-chat-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1rem;
    background: rgba(15, 20, 25, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Chat Message */
.chat-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    /* Removed fade-in animation - text must be visible immediately */
}

.chat-message:last-child {
    margin-bottom: 0;
}

/* Chat message revealed state (triggered by scroll) */
.chat-message.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for sequential appearance */
.chat-message:nth-child(1).revealed {
    transition-delay: 0.1s;
}

.chat-message:nth-child(2).revealed {
    transition-delay: 0.3s;
}

.chat-message:nth-child(3).revealed {
    transition-delay: 0.5s;
}

.chat-message:nth-child(4).revealed {
    transition-delay: 0.7s;
}

.chat-message:nth-child(5).revealed {
    transition-delay: 0.9s;
}

.chat-message:nth-child(6).revealed {
    transition-delay: 1.1s;
}

/* User Message (LEFT aligned - user asks from left) */
.chat-message--user {
    justify-content: flex-start;
}

/* AI Message (RIGHT aligned - AI responds from right with Dmytro's photo) */
.chat-message--ai {
    justify-content: flex-end !important; /* Force right alignment */
    flex-direction: row-reverse !important; /* Avatar on right */
    text-align: right; /* Ensure text aligns right */
}

/* Chat Avatar */
.chat-message__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Avatar Image (for photo of Dmytro) */
.chat-message__avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.chat-message--ai:hover .chat-message__avatar-img {
    border-color: var(--color-brand-cyan);
    transform: scale(1.05);
}

.chat-message__avatar--user {
    background: linear-gradient(135deg, var(--color-brand-purple), var(--color-brand-pink));
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.chat-message__avatar--ai {
    background: linear-gradient(135deg, var(--color-brand-cyan), var(--color-brand-purple));
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    animation: glow-pulse 3s ease-in-out infinite;
}

.chat-message__avatar i {
    width: 24px;
    height: 24px;
    color: #FFFFFF;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.6); }
}

/* Chat Message Content */
.chat-message__content {
    flex: 0 1 auto; /* Allow content to shrink/grow based on content */
    max-width: 70%; /* Maximum width limit */
    padding: 1rem 1.25rem;
}

/* User Message Content (LEFT side - simple question bubble) */
.chat-message--user .chat-message__content {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    max-width: max-content; /* Fit content width exactly, no extra space */
    width: auto; /* Auto width based on content */
    margin-left: 0; /* Stay on left side */
    margin-right: auto; /* Allow space on right */
}

/* AI Message Content (RIGHT side - detailed response with photos) */
.chat-message--ai .chat-message__content {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: left; /* Reset text-align for content inside */
    margin-left: auto; /* Push to the right side */
    margin-right: 0; /* Align to right edge */
}

/* Chat Header (AI only) */
.chat-message__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-ai-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #06B6D4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Typing Indicator - Always visible for icon rendering */
.chat-typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.chat-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--color-brand-cyan);
    border-radius: 50%;
    opacity: 0.4;
}

.chat-typing-indicator span:nth-child(1) {
    animation: typing-dot 1.4s ease-in-out infinite;
}

.chat-typing-indicator span:nth-child(2) {
    animation: typing-dot 1.4s ease-in-out 0.2s infinite;
}

.chat-typing-indicator span:nth-child(3) {
    animation: typing-dot 1.4s ease-in-out 0.4s infinite;
}

@keyframes typing-dot {
    0%, 60%, 100% { opacity: 0.4; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

/* Chat Message Text */
.chat-message__text {
    font-size: 1rem !important; /* Override global p{font-size:1.125rem} */
    line-height: 1.7;
    color: var(--color-text-primary);
    font-weight: 400 !important; /* Same weight for both questions and answers */
    margin-bottom: 0 !important; /* Remove bottom margin */
}

.chat-message--user .chat-message__text {
    color: var(--color-text-primary);
    font-size: 1rem !important; /* Explicit size for user questions, override global p */
    font-weight: 400 !important;
    margin-bottom: 0 !important; /* Remove bottom margin */
}

.chat-message--ai .chat-message__text {
    color: var(--color-text-primary);
    font-size: 1rem !important; /* Same size as questions, override global p */
    font-weight: 400 !important; /* Same weight as questions */
    margin-bottom: 0 !important; /* Remove bottom margin */
}

/* Chat Paragraph - NO opacity animation on parent to allow icon rendering */
.chat-paragraph {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--color-text-primary);
    font-size: 1rem !important; /* Override global p{font-size:1.125rem} */
    font-weight: 400 !important; /* Ensure same weight as questions */
}

.chat-paragraph:last-child {
    margin-bottom: 0;
}

/* Text styling - animation removed for immediate visibility */
.chat-paragraph span {
    /* Removed opacity: 0 and animation - text must be visible immediately */
    font-size: 1rem !important; /* Override any inherited styles */
    font-weight: 400 !important;
}

/* Chat Icons */
.chat-icon {
    width: 20px;
    height: 20px;
    color: var(--color-brand-cyan);
    flex-shrink: 0;
    margin-top: 3px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================================
   CHAT HYBRID CARD - Good News Message (Full Width)
   Full-width message with feature cards inside, no avatar
   ================================================ */

/* Full Width Message Variant (no avatar, no alignment) */
.chat-message--fullwidth {
    justify-content: center; /* Center the content block */
    margin-top: 2rem; /* Extra spacing from previous messages */
}

/* Content with Cards - Full Width */
.chat-message--fullwidth .chat-message__content {
    max-width: 100% !important; /* Full width of chat container */
    width: 100%;
    margin: 0; /* Reset margins */
}

.chat-message__content--cards {
    max-width: 100% !important;
    padding: 2rem !important;
    background: rgba(26, 31, 58, 0.6); /* Slightly lighter background for prominence */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Good News Header (inside AI bubble) */
.chat-good-news-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.chat-good-news-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.chat-icon--success {
    width: 32px;
    height: 32px;
    color: var(--color-success);
}

/* Feature Cards Grid (inside chat bubble) */
.chat-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Individual Feature Card (compact version for chat) */
.chat-feature-card {
    background: rgba(15, 20, 25, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-brand-cyan), var(--color-brand-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.chat-feature-card:hover::before {
    opacity: 1;
}

/* Feature Card Icon */
.chat-feature-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-brand-cyan), var(--color-brand-purple));
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.chat-feature-card__icon i {
    width: 28px;
    height: 28px;
    color: #FFFFFF;
}

.chat-feature-card:hover .chat-feature-card__icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

/* Feature Card Title */
.chat-feature-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

/* Feature Card Description */
.chat-feature-card__description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.85);
    margin: 0;
}

@media (max-width: 768px) {
    .about-modern-2025 {
        padding: 3rem 0;
    }

    .about-modern-2025 .container {
        padding: 0 12px;
    }

    .ai-chat-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .chat-message {
        gap: 0.75rem;
    }

    .chat-message__avatar {
        width: 44px;
        height: 44px;
    }

    .chat-message__content {
        max-width: 100%;
        width: 100%;
        padding: 1rem !important;
    }

    .chat-message--user .chat-message__content,
    .chat-message--ai .chat-message__content {
        border-radius: var(--radius-lg);
    }

    .chat-message--user .chat-message__content {
        width: auto;
        max-width: 95%;
    }

    .chat-message__content--cards {
        padding: 1.25rem !important;
    }

    .chat-features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chat-message__avatar i {
        width: 18px;
        height: 18px;
    }

    .chat-message__avatar-img {
        width: 44px;
        height: 44px;
    }

    .chat-message__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .chat-ai-badge {
        font-size: 0.7rem;
    }

    .chat-paragraph {
        font-size: 1rem !important;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .chat-paragraph span {
        font-size: 1rem !important;
    }

    .chat-icon {
        width: 18px;
        height: 18px;
    }
}
