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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    background: white;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 50px;
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.5em;
    color: #666;
    margin-bottom: 10px;
}

.subtitle {
    color: #999;
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 5px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature .icon {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

.feature h3 {
    margin-bottom: 10px;
    color: #667eea;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

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

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Chat Container */
.chat-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status {
    color: #4ade80;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.user-message, .ai-message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
    padding: 15px;
    border-radius: 15px;
    margin: 0 10px;
}

.user-message .message-content {
    background: #667eea;
    color: white;
}

.ai-message .message-content {
    background: white;
    border: 2px solid #e0e0e0;
}

.message-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.chat-input {
    padding: 20px;
    background: white;
    border-radius: 0 0 20px 20px;
    border-top: 2px solid #e0e0e0;
}

.chat-input form {
    display: flex;
    gap: 10px;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
}

.chat-input input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Admin Panel */
.admin-container {
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.admin-header {
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.conversations-list {
    width: 350px;
    border-right: 2px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

.conversations-list h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.conversation-item {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.3s;
    border: 2px solid #e0e0e0;
    position: relative;
}

.conversation-item:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.conversation-item strong {
    display: block;
    margin-bottom: 5px;
}

.conversation-item p {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.conversation-item .time {
    font-size: 0.8em;
    color: #999;
    position: absolute;
    top: 15px;
    right: 15px;
}

.badge-waiting {
    display: inline-block;
    background: #fbbf24;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    margin-top: 5px;
}

.conversation-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#conversationMessages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.empty-state {
    text-align: center;
    color: #999;
    margin-top: 100px;
    font-size: 1.2em;
}

.admin-input {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.admin-input textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
}

.admin-input textarea:focus {
    outline: none;
    border-color: #667eea;
}

.user-panel {
    margin-top: 30px;
}

.user-panel p {
    margin-bottom: 20px;
    font-size: 1.2em;
}