* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --vh: 1vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #343541;
    color: #ececf1;
    line-height: 1.6;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    margin: 0;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* iOS Safari fixes */
    -webkit-overflow-scrolling: touch;
    position: fixed;
    width: 100%;
}

body::-webkit-scrollbar {
    display: none;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    max-height: 100vh;
    max-height: calc(var(--vh, 1vh) * 100);
}

.header {
    background-color: #202123;
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #4a4b53;
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ececf1 0%, #10a37f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1rem;
    color: #8e8ea0;
    font-weight: 400;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    padding: 0 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 0;
    scrollbar-width: thin;
    scrollbar-color: #565869 transparent;
    /* Mobile scrolling improvements */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Ensure proper scrolling on mobile */
    min-height: 0;
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #565869;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #8e8ea0;
}

.message {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

.message.user {
    background-color: #343541;
}

.message-content {
    flex: 1;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.assistant .message-content {
    background-color: rgba(68, 70, 84, 0.8);
}

.message.user .message-content {
    background-color: rgba(52, 53, 65, 0.8);
}

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

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.input-container {
    background-color: #343541;
    border-top: 1px solid #4a4b53;
    padding: 2rem 1rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    position: relative;
    /* Ensure input stays visible on mobile */
    z-index: 10;
    /* iOS Safari safe area support */
    min-height: 80px;
}

.input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #4a4b53 50%, transparent 100%);
}

.input-form {
    max-width: 900px;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(64, 65, 79, 0.8);
    border: 2px solid #565869;
    border-radius: 1.5rem;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: #10a37f;
    box-shadow: 0 8px 32px rgba(16, 163, 127, 0.2);
    transform: translateY(-2px);
}



#promptInput {
    flex: 1;
    background: none;
    border: none;
    color: #ececf1;
    font-size: 1.1rem;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.6;
    max-height: 200px;
    min-height: 28px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    font-weight: 400;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#promptInput::-webkit-scrollbar {
    display: none;
}

#promptInput::placeholder {
    color: #8e8ea0;
    font-weight: 400;
    opacity: 0.8;
}

#promptInput::placeholder {
    color: #8e8ea0;
}

.submit-btn {
    background: rgba(16, 163, 127, 0.1);
    border: 1px solid rgba(16, 163, 127, 0.3);
    color: #10a37f;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    backdrop-filter: blur(10px);
}

.submit-btn:hover {
    background: rgba(16, 163, 127, 0.2);
    border-color: rgba(16, 163, 127, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}



.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Domain results table */
.domain-results {
    margin-top: 1.5rem;
}

.domain-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(68, 70, 84, 0.8);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.domain-table th,
.domain-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #565869;
}

.domain-table th {
    background-color: rgba(64, 65, 79, 0.9);
    font-weight: 600;
    color: #ececf1;
    padding: 1.25rem 1rem;
}

.domain-table tr:last-child td {
    border-bottom: none;
}

.domain-table tr:hover {
    background-color: rgba(74, 75, 83, 0.6);
    transition: background-color 0.2s ease;
}

.status-available {
    color: #10a37f;
    font-weight: 600;
}

.status-taken {
    color: #ff6b6b;
    font-weight: 600;
}

.buy-link {
    color: #10a37f;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background-color: rgba(16, 163, 127, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(16, 163, 127, 0.2);
    backdrop-filter: blur(10px);
}

.buy-link:hover {
    background-color: rgba(16, 163, 127, 0.2);
    border-color: rgba(16, 163, 127, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}

/* Loading animation */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8e8ea0;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #565869;
    border-top: 2px solid #10a37f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 0.25rem 1rem;
        padding-top: calc(0.25rem + env(safe-area-inset-top));
    }
    
    .chat-messages {
        padding: 1rem 0;
        /* Better mobile scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .input-container {
        padding: 1rem 0.5rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .input-wrapper {
        padding: 0.75rem 1rem;
        border-radius: 1.25rem;
    }
    
    #promptInput {
        font-size: 1rem;
        min-height: 24px;
        /* Prevent zoom on iOS */
        font-size: 16px;
    }
    
    .domain-table th,
    .domain-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .message-content {
        padding: 1rem;
        border-radius: 0.75rem;
    }
    
    /* iOS Safari specific fixes */
    .container {
        height: 100dvh;
        max-height: 100dvh;
    }
    
    .chat-container {
        height: 100%;
        max-height: 100dvh;
    }
} 