/* Chat Demo Window Styles */

/* Override parent container width to allow wider chat window */
.hero .hero-content {
    max-width: 100%; /* or 1280px, allowing children to control their width */
    padding-left: 0;
    padding-right: 0;
}

/* Restore width constraint for text content */
.hero-content > *:not(.chat-demo-container) {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.chat-demo-container {
    width: 700px; /* Fixed width on desktop to prevent resizing */
    max-width: 95%; /* Responsive fallback for mobile */
    margin: 2rem auto 4rem;
    perspective: 1000px;
    transform-style: preserve-3d;
    animation: fade-in-up 1s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Light Theme Window */
.mac-window {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 30px rgba(88, 199, 181, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    width: 100%; /* Ensure full width of container */
    font-family: 'Inter', sans-serif;
    position: relative;
}

/* Window Header */
.window-header {
    background: #f8f9fa;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.window-title {
    flex: 1;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Window Body */
.window-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Sidebar - Narrow Light Theme */
.app-sidebar {
    width: 80px;
    background: #ffffff;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    align-items: center;
    gap: 16px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    flex: 1;
}

.sidebar-menu-item {
    padding: 10px;
    border-radius: 12px;
    color: #adb5bd;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    width: 48px;
    height: 48px;
}

.sidebar-menu-item:hover, .sidebar-menu-item.active {
    color: #6c757d; /* Dark gray for active/hover */
    /* No background for this specific clean look, or subtle if needed */
}

/* margin-top-auto helper */
.sidebar-menu-item.margin-top-auto {
    margin-top: auto;
}

/* Main Content area (Chat) */
.app-content {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    color: #333333; /* Dark text for light theme */
    overflow: hidden;
    min-height: 0;
    min-width: 0; /* PREVENT FLEX BLOWOUT */
}

.app-top-bar {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.top-bar-icons {
    display: flex;
    gap: 20px;
    align-items: center;
    color: #adb5bd;
}

.top-bar-icons i {
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.top-bar-icons i:hover {
    color: var(--primary-color);
}

.user-profile-icon {
    width: 32px;
    height: 32px;
    background: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.user-profile-icon i {
    font-size: 1rem;
}



.chat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    margin-right: auto; /* Push icons to the right */
    text-align: left;
}

.chat-info h4 {
    font-size: 1rem;
    color: #333333;
    margin-bottom: 0;
    font-weight: 600;
}

.chat-info span {
    font-size: 0.8rem;
    color: #adb5bd;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.chat-messages > :first-child {
    margin-top: auto;
}

.message {
    display: flex;
    gap: 8px;
    max-width: 80%;
    animation: message-pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes message-pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.message.ai {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.ai .message-avatar {
    background: transparent;
    color: #000;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Softer shadow */
    text-align: left;
    word-wrap: break-word;
    word-break: break-word; /* handle long words */
    overflow-wrap: break-word;
    min-width: 0; /* allows flex item to shrink */
}

.message.user .message-bubble {
    background: var(--primary-color);
    color: #ffffff; /* White text on Teal */
    border-bottom-right-radius: 2px;
}

.message.ai .message-bubble {
    background: #f8f9fa;
    color: #333;
    border-bottom-left-radius: 2px;
    border: 1px solid #e9ecef;
}

/* Typing Animation */
.typing-indicator {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    border: 1px solid #e9ecef;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #adb5bd;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Generating State */
.generating-state {
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: italic;
    color: var(--primary-color);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(88, 199, 181, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input Area */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #ffffff;
}

.input-wrapper {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6c757d;
}

.input-text-group {
    display: flex;
    align-items: center;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: none;
    cursor: default;
    font-size: 1.2rem;
    color: #adb5bd;
    margin-right: 12px;
}

/* Removed hover effect to indicate non-clickable */
/* .sidebar-toggle-btn:hover {
    color: var(--primary-color);
} */

@media (max-width: 768px) {
    .app-sidebar {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }


    .app-sidebar.show-sidebar {
        display: flex;
    }

    .sidebar-toggle-btn {
        display: block;
        cursor: default;
    }


    .chat-demo-container {
        width: 90%;
        max-width: 100%;
        margin: 1rem auto;
    }
}

/* Report Card Styles within Chat */
.report-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    padding: 12px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 280px; /* Responsive max width */
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f8f9fa;
}

.report-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.report-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.chart-row {
    margin-bottom: 10px;
}

.chart-row:last-child {
    margin-bottom: 0;
}

.chart-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #868e96;
    margin-bottom: 4px;
}

.chart-bar-bg {
    height: 6px;
    background: #f1f3f5;
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 1s ease-out;
}

.chart-bar-fill.warning {
    background: #ffc107;
}

.chart-bar-fill.danger {
    background: #ff6b6b;
}

.chart-bar-fill.success {
    background: #51cf66;
}

/* Initial state for the Mac Window */
#demoWindow {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

#demoWindow.visible {
    display: flex;
    animation: fade-in-up 0.8s ease-out forwards;
}

/* Eye-catching Button Styles */
.btn-shine {
    position: relative;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--gradient-neon);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(88, 199, 181, 0.5);
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
    z-index: 10;
}

.btn-shine:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(88, 199, 181, 0.8);
}

.shine-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: 0.5s;
    animation: shine-anim 3s infinite;
}

@keyframes shine-anim {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* Intro Container */
.intro-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    margin-bottom: 2rem;
}

.typing-text {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff; /* Explicitly set to white or var(--text-primary) if defined in main CSS */
    min-height: 7rem; /* Reserve space for multiple lines */
    position: relative;
    text-align: center;
    margin-bottom: 0;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: pre-wrap;
    line-height: 1.4;
}

.typing-text::after {
    content: '|';
    display: inline-block;
    margin-left: 5px;
    animation: blink-cursor 0.7s infinite;
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color); /* Override gradient for cursor */
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Fix visibility of gradient text on light background */
.hero-title .gradient-text {
    /* Use darker colors for visibility on light background: Teal 600 to Cyan 700 */
    background-image: linear-gradient(135deg, #00897b 0%, #0097a7 50%, #00897b 100%);
    /* Enhance contrast further with a subtle drop shadow */
    filter: drop-shadow(0 2px 4px rgba(0, 137, 123, 0.25));
}