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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
    max-height: none;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.info {
    font-size: 0.9em;
    opacity: 0.8;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.5;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.system-message {
    justify-content: center;
}

.system-message .message-content {
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    max-width: 90%;
    text-align: center;
}

.loading {
    display: flex;
    gap: 5px;
    padding: 10px;
}

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

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

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

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

.input-container {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    background: #fafafa;
}

#user-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    transition: border-color 0.3s;
}

#user-input:focus {
    outline: none;
    border-color: #667eea;
}

#send-button {
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

footer {
    padding: 15px 30px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
    gap: 10px;
}

.github-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.github-link a:hover {
    text-decoration: underline;
}

#model-status {
    color: #4caf50;
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    header h1 {
        font-size: 2em;
    }

    .message-content {
        max-width: 90%;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* About Section */
.about-section {
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.about-toggle {
    width: 100%;
    padding: 15px 30px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.about-toggle:hover {
    background: rgba(102, 126, 234, 0.05);
}

#about-arrow {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.about-content {
    padding: 0 30px 30px 30px;
    line-height: 1.6;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
}

.about-intro {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.about-intro p {
    margin-bottom: 10px;
}

.about-intro p:last-child {
    margin-bottom: 0;
}

.key-components h3,
.model-specs h3,
.built-with h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.component {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.component h4 {
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.component ul,
.model-specs ul,
.built-with ul {
    list-style: none;
    padding-left: 0;
}

.component ul li,
.model-specs ul li,
.built-with ul li {
    padding: 5px 0 5px 20px;
    position: relative;
}

.component ul li:before,
.model-specs ul li:before,
.built-with ul li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.model-specs,
.built-with {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-top: 20px;
}

.model-specs ul li strong,
.built-with ul li strong,
.component ul li strong {
    color: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    .about-content {
        padding: 0 20px 20px 20px;
    }
    
    .about-toggle {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .component,
    .model-specs,
    .built-with {
        padding: 12px;
    }
}

/* Example Prompts */
.example-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.example-prompt {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.example-prompt:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.example-prompt:active {
    transform: translateY(0);
}

/* Chat Actions */
.chat-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #666;
    transition: all 0.2s;
}

.action-button:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

.action-button svg {
    width: 16px;
    height: 16px;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.copy-button {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #666;
    transition: all 0.2s;
}

.copy-button:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

/* Message Timing */
.message-timing {
    font-size: 0.75em;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .example-prompts {
        flex-direction: column;
    }
    
    .example-prompt {
        width: 100%;
        text-align: center;
    }
    
    .chat-actions {
        padding: 8px 15px;
    }
    
    .action-button {
        padding: 5px 10px;
        font-size: 0.85em;
    }
}

/* Footer Links */
.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}
