:root {
    --primary: #00d8ff;
    --secondary: #ff2d75;
    --dark: #0a0a1a;
    --light: #e6e6e6;
    --accent: #7b2dff;
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--dark);
    color: var(--light);
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

body.racing-theme::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="30"><path d="M0,15 h20 v15 h10 v-15 h20 v15 h10 v-15 h20 v15 h10 v-15" stroke="%23ffffff" stroke-width="1.5" fill="none"/></svg>') repeat-x bottom;
    opacity: 0.2;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.chat-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border);
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--light);
    opacity: 0.7;
}

#chat-history {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    scrollbar-width: none;
}

#chat-history::-webkit-scrollbar {
    display: none;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message.user {
    background: rgba(255, 45, 117, 0.1);
    margin-left: auto;
    border: 1px solid rgba(255, 45, 117, 0.2);
}

.message.assistant {
    background: rgba(0, 216, 255, 0.1);
    margin-right: auto;
    border: 1px solid rgba(0, 216, 255, 0.2);
}

.message.loading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: none;
    border: none;
}

.tire-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.message.loading .tire-spinner {
    display: block;
}

.btn.loading .tire-spinner {
    display: inline-block;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.input-area {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

#user-input {
    flex-grow: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 0.95rem;
}

#user-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

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

.btn.loading span {
    opacity: 0.5;
}

/* Form styles */
.create-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.create-form h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-option {
    text-align: center;
    cursor: pointer;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-option input[type="radio"]:checked + .theme-preview {
    border-color: var(--primary);
}

.theme-preview {
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--border);
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.theme-option label {
    font-size: 0.85rem;
    color: var(--light);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .chat-container {
        height: 90vh;
    }
    
    .message {
        max-width: 90%;
    }
    
    .create-form h1,
    .header h1 {
        font-size: 1.5rem;
    }
}