/* SHAH Website — Dark Theme */

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d28;
    --bg-tertiary: #242736;
    --accent: #4f8ff7;
    --accent-hover: #3a7de6;
    --accent-glow: rgba(79, 143, 247, 0.15);
    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --text-heading: #ffffff;
    --border: #2d3044;
    --border-light: #383b50;
    --success: #22c55e;
    --chat-user: #4f8ff7;
    --chat-assistant: #242736;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ── Header ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 28px;
}

.nav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.nav a:hover {
    color: var(--text-heading);
}

/* ── Hero ── */
.hero {
    padding: 140px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 20px;
    line-height: 1.15;
}

.hero-tagline {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 40px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Features ── */
.features {
    padding: 80px 0;
}

.features h2,
.architecture h2,
.languages h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

.feature-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
    margin-bottom: 16px;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Architecture ── */
.architecture {
    padding: 80px 0;
}

.arch-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.arch-step {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.arch-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.arch-step h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.arch-step p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.arch-arrow {
    color: var(--accent);
    font-size: 24px;
    align-self: center;
    padding-top: 20px;
}

/* ── Languages ── */
.languages {
    padding: 80px 0;
}

.languages-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: -32px;
    margin-bottom: 40px;
}

.languages-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.lang-tag {
    display: inline-block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    transition: border-color var(--transition), color var(--transition);
}

.lang-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Footer ── */
.site-footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Chat Widget ── */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(79, 143, 247, 0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}

.chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(79, 143, 247, 0.5);
}

.chat-toggle svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.chat-icon-close {
    display: none;
}

.chat-widget.open .chat-icon-open {
    display: none;
}

.chat-widget.open .chat-icon-close {
    display: block;
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 400px;
    height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-widget.open .chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.chat-header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
}

.chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.chat-close:hover {
    color: var(--text-heading);
}

.chat-close svg {
    width: 16px;
    height: 16px;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--chat-user);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.chat-message.assistant {
    align-self: flex-start;
    background: var(--chat-assistant);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.chat-message code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
    background: var(--chat-assistant);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    border-bottom-left-radius: 2px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input Area */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    max-height: 96px;
    outline: none;
    transition: border-color var(--transition);
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.chat-send {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), opacity var(--transition);
}

.chat-send:hover {
    background: var(--accent-hover);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .arch-arrow {
        display: none;
    }

    .arch-flow {
        flex-direction: column;
        align-items: center;
    }

    .arch-step {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero-tagline {
        font-size: 16px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 28px;
    }

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

    .nav {
        gap: 16px;
    }

    .nav a {
        font-size: 13px;
    }

    .chat-panel {
        width: calc(100vw - 48px);
        height: calc(100vh - 120px);
        right: -12px;
    }
}
