/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Hide scrollbar for IE, Edge and Firefox */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    /* Hide scrollbar for Chrome, Safari and Opera */
    display: none;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: #0a0a0a;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    /* Hide scrollbar */
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    text-decoration: none;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    position: relative;
    z-index: 10;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 90px 0 40px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(59, 130, 246, 0.1) 49%, rgba(59, 130, 246, 0.1) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(168, 85, 247, 0.05) 49%, rgba(168, 85, 247, 0.05) 51%, transparent 52%);
    background-size: 60px 60px;
    animation: heroGrid 20s linear infinite;
    opacity: 0.3;
}

@keyframes heroGrid {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -1px;
    text-align: center;
}

.highlight {
    background: linear-gradient(45deg, #60a5fa, #a78bfa, #34d399);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #94a3b8;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.typing-text {
    color: #3b82f6;
    font-weight: 700;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #cbd5e1;
    line-height: 1.7;
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 600px;
    min-height: 500px;
    max-height: 700px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

@media (min-width: 768px) {
    .chat-container {
        height: 650px;
        min-height: 600px;
        max-height: 750px;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Override global scrollbar hide for chat messages (keep it hidden) */
.chat-messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
    width: 0;
    height: 0;
}

/* Messages */
.message {
    display: flex;
    max-width: 80%;
}

@media (min-width: 768px) {
    .message {
        max-width: 70%;
    }
}

.user-message {
    margin-left: auto;
    justify-content: flex-end;
}

.assistant-message {
    justify-content: flex-start;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 1rem;
    /* Prevent breaking words in the middle - break at word boundaries */
    word-break: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: none;
    /* Ensure consistent text rendering */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Remove any default margins or indents */
    margin: 0;
    text-indent: 0;
}

/* Bold text styling */
.message-content strong {
    font-weight: 600;
    color: #ffffff;
    /* Allow wrapping for very long terms, but prefer to keep together */
    white-space: normal;
}

.user-message .message-content {
    background: #3b82f6;
    color: #ffffff;
    border: none;
}

.assistant-message .message-content {
    background: #1a1a1a;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #3b82f6;
}

.message-content h2:first-child {
    margin-top: 0;
}

.message-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #60a5fa;
}

.message-content h3:first-child {
    margin-top: 0;
}

.message-content p {
    margin: 0.75rem 0;
    color: #cbd5e1;
    line-height: 1.8;
    word-break: normal;
    overflow-wrap: break-word;
    text-indent: 0;
    padding: 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 600;
    color: #ffffff;
}

.message-content a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
}

.message-content a:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.message-content ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    width: 100%;
}

.message-content li {
    margin: 0.75rem 0;
    color: #cbd5e1;
    line-height: 1.8;
    word-break: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
    display: block;
    text-indent: 0;
}

.message-content li:first-child {
    margin-top: 0;
}

.message-content li:last-child {
    margin-bottom: 0;
}

.message-content li::before {
    content: "•";
    color: #3b82f6;
    position: absolute;
    left: 0.5rem;
    top: 0.1em;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.8;
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: fit-content;
}

.loading-dots {
    display: flex;
    gap: 0.25rem;
}

.loading-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #3b82f6;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-text {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Chat Input */
.chat-input-form {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.chat-input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-send-btn {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.chat-send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
}

.chat-send-btn:disabled {
    background: #64748b;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hero {
        padding: 80px 0 40px;
        min-height: auto;
    }

    .hero-container {
        padding: 0 1rem;
    }
    
    .chat-container {
        height: 500px !important;
        min-height: 400px !important;
        max-height: 600px !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .message {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0 30px;
    }

    .chat-container {
        height: 450px;
        min-height: 400px;
        max-height: 550px;
        width: 100%;
        max-width: 100%;
    }
}
