/* ==========================================================================
   Finologi AI (Fyna) - Styles
   Modern, Fun, Interactive AI Chat Interface
   ========================================================================== */

:root {
    --primary-green: #10b981;
    --primary-blue: #3b82f6;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.fyna-container {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */


.language-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    justify-content: center; 
    margin-top: 8px;
 }

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.lang-btn:hover { background: rgba(0,0,0,0.04); }
.lang-active {
    background: linear-gradient(90deg,#10b981,#3b82f6);
    color: #fff;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 2px 6px rgba(16,185,129,0.12);
}
.lang-divider { opacity: 0.6; margin: 0 4px; }

.fyna-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.hero-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.08;
}

.hero-gradient-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
    flex-direction: column;
    display: flex;
    gap: 12px;
}

.fyna-avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 4px solid var(--bg-primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.fyna-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.start-chat-btn {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.start-chat-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   Chat Interface Section
   ========================================================================== */

.chat-interface-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.chat-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Chat Main Area */
.chat-main {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    height: 700px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fyna-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--primary-green);
}

.fyna-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fyna-status h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: var(--radius-full);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-header-right {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.icon-btn svg {
    stroke: var(--text-secondary);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.message-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: slideInMessage 0.4s ease-out;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    flex-direction: row;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
    line-height: 1.6;
    animation: bubbleIn 0.3s ease-out;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bot-message .message-bubble {
    background: var(--gradient-subtle);
    border: 1px solid rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.user-message .message-bubble {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.message-bubble p {
    margin: 0;
}

.message-bubble p + p {
    margin-top: 0.75rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: 0 0.5rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--gradient-subtle);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: var(--radius-full);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.quick-actions-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.quick-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-action-btn {
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--gradient-subtle);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Chat Input Area */
.chat-input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.attach-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.attach-btn:hover {
    background: var(--bg-tertiary);
}

.attach-btn svg {
    stroke: var(--text-secondary);
}

#userInput {
    flex: 1;
    min-height: 24px;
    max-height: 120px;
    padding: 0.5rem;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    resize: none;
}

#userInput::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    stroke: var(--bg-primary);
}

.input-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ==========================================================================
   Context Panel
   ========================================================================== */

.context-panel {
    position: sticky;
    top: 100px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.context-header {
    margin-bottom: 1.5rem;
}

.context-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.context-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.context-card {
    padding: 1.5rem;
    background: var(--gradient-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.context-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.context-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.context-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.context-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.context-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

.context-link:hover {
    gap: 0.5rem;
}

.context-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.info-badge {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--gradient-subtle);
    border-radius: var(--radius-lg);
}

.badge-icon {
    font-size: 1.5rem;
}

.badge-content strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.badge-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.fyna-cta {
    padding: 4rem 2rem;
    background: var(--gradient-primary);
    text-align: center;
    color: var(--bg-primary);
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.fyna-cta h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.fyna-cta p {
    font-size: 1.125rem;
    line-height: 1.7;
    opacity: 0.95;
    margin-bottom: 2.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--bg-primary);
    color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: transparent;
    color: var(--bg-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    border-color: var(--bg-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
    
    .context-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .chat-main {
        height: 600px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-action-btn {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
    
    .fyna-cta h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .chat-interface-section {
        padding: 2rem 1rem;
    }
    
    .chat-main {
        height: 500px;
        border-radius: var(--radius-lg);
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}