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

:root {
    --bg-dark: #0a0a0f;
    --bg-chat: #12121a;
    --bg-message-bot: #1a1a2e;
    --bg-message-user: #2d5a27;
    --text-primary: #e8e8e8;
    --text-secondary: #888;
    --accent: #c41e3a;
    --accent-light: #ff6b6b;
    --border: #2a2a3a;
    --snow: #fff;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.chat-container {
    max-width: 600px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--accent) 0%, #8b0000 100%);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--snow);
}

.header-text h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--snow);
}

.status {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

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

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    background: var(--bg-message-bot);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.message.user {
    background: var(--bg-message-user);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Loading */
.loading {
    align-self: flex-start;
    padding: 16px 20px;
    background: var(--bg-message-bot);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.loading.hidden {
    display: none;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Input */
.chat-input {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-message-bot);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input input:focus {
    border-color: var(--accent);
}

.chat-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input input::placeholder {
    color: var(--text-secondary);
}

.chat-input button {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: var(--snow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.chat-input button:hover:not(:disabled) {
    background: var(--accent-light);
}

.chat-input button:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input button svg {
    width: 20px;
    height: 20px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 600px) {
    .chat-container {
        border-radius: 0;
    }

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

/* ========== ADMIN STYLES ========== */

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 24px;
    color: var(--text-primary);
}

.admin-header a {
    color: var(--accent);
    text-decoration: none;
}

.admin-header a:hover {
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-message-bot);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-message-bot);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

td {
    color: var(--text-primary);
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge.male {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge.female {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.badge.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge.pending {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.drinks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.drink-item {
    background: var(--bg-message-bot);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.drink-item .name {
    font-weight: 500;
}

.drink-item .count {
    color: var(--accent);
    margin-left: 8px;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-item {
    background: var(--bg-message-bot);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.skill-item .name {
    font-weight: 600;
    margin-bottom: 4px;
}

.skill-item .occupation {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.skill-item .skills {
    color: var(--accent-light);
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-form {
    background: var(--bg-chat);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-message-bot);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--accent);
}

.login-form button {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: var(--snow);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-form button:hover {
    background: var(--accent-light);
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.contribution-info {
    background: var(--bg-message-bot);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.contribution-info h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.contribution-rates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.rate-item {
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: 8px;
}

.rate-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.rate-item .amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-light);
}
