/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #050505; /* Deep rich black, not just #000 */
    --text-color: #ffffff;
    --muted: rgba(255, 255, 255, 0.5);
    --btn-bg: #ffffff;
    --btn-text: #000000;
}

/* Custom font face for the ASKALX logo */
@font-face {
    font-family: 'Lazenby Computer';
    src: url('askalx-font/LazenbyCompLiquid.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    /* Modern typography stack defaulting to Inter */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Subtle radial gradient to avoid Flat UI feel and give depth */
    background: radial-gradient(circle at center, #151515 0%, #000000 100%);
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4.5rem; /* Space out the 3 vertical elements based on mockup */
    padding: 2rem;
    max-width: 900px;
    width: 100%;
}

/* Top Heading */
h1 {
    font-weight: 300;
    font-size: 2.5rem; /* Roughly matches mockup proportions */
    letter-spacing: 0.5px;
    opacity: 0.95;
}

/* Logo Text */
.logo {
    font-family: 'Lazenby Computer', monospace;
    font-size: 6.5rem; /* Very large text */
    letter-spacing: 0.3rem;
    line-height: 1;
    /* Extremely subtle glow to emulate a premium screen rendering */
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}

/* Call to Action Bar / Text Input */
.chat-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
    transition: all 0.5s ease;
}

.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.05); /* very subtle frosted look */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    transition: all 0.3s ease;
    /* Soft premium glow */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0);
}

.search-container:focus-within {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    outline: none;
    padding: 0.5rem 0;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#mic-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#mic-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

#mic-btn.active {
    color: #ff4a4a;
    background-color: rgba(255, 74, 74, 0.1);
}

#mic-btn.speaking {
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.7; }
}

/* Chat History Layout */
.chat-history {
    display: none; /* Hidden until first interaction */
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    min-height: 200px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 2rem;
    padding: 1rem;
    /* Custom thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}
.chat-history::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.message {
    max-width: 80%;
    margin-bottom: 1rem;
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-user {
    align-self: flex-end;
}

.msg-user .msg-text {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 18px 18px 0px 18px;
    font-size: 1.05rem;
    line-height: 1.4;
}

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

.msg-ai .msg-text {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.2rem;
    border-radius: 18px 18px 18px 0px;
    font-size: 1.05rem;
    line-height: 1.5;
    /* Add subtle border instead of background for AI to contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Thinking Indicator */
.thinking-indicator .msg-text {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1rem 1.2rem;
}

.thinking-indicator .dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

/* Chat Active Layout Adjustments */
body.chat-active {
    align-items: flex-start;
    padding-top: 5vh;
}

body.chat-active .container {
    gap: 2rem;
}

body.chat-active h1 {
    font-size: 1.5rem;
    opacity: 0.5;
    margin-bottom: -1rem;
}

body.chat-active .logo {
    font-size: 3rem;
}

/* Micro-animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

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

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .container {
        gap: 3.5rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .logo {
        font-size: 4.5rem;
    }
    .chat-btn {
        padding: 0.9rem 2.5rem;
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .container {
        gap: 2.5rem;
    }
    h1 {
        font-size: 1.4rem;
    }
    .logo {
        font-size: 3.2rem;
        letter-spacing: 0.1rem;
    }
    .chat-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    transition: opacity 0.5s ease;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--muted);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    color: var(--text-color);
}

.button-icon {
    transition: color 0.3s ease;
}

/* Subtle brand colors on hover */
a[href^="tel:"]:hover .button-icon {
    color: #34C759;
    /* iOS Green */
}

a[href^="mailto:"]:hover .button-icon {
    color: #EA4335;
    /* Email Red */
}

a[href^="https://t.me/"]:hover .button-icon {
    color: #2AABEE;
    /* Telegram Blue */
}

a[href^="https://askalx.com.au"]:hover .button-icon {
    color: #FF9F0A;
    /* Orange for More/Help */
}
