/* assets/css/style.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Landing */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at top, #1e1b4b, var(--bg));
}

.landing-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

.logo { font-size: 48px; text-align: center; margin-bottom: 10px; }
.landing-card h1 { text-align: center; margin-bottom: 8px; font-size: 28px; }
.subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 14px; }

.alert {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert a { color: #a5b4fc; }

.login-form { display: flex; flex-direction: column; gap: 12px; }

input, textarea, select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary, .btn-secondary {
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    width: 100%;
}
.btn-secondary:hover { background: var(--bg-input); }

.divider {
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    position: relative;
}
.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}
.divider span { background: var(--bg-card); padding: 0 12px; position: relative; }

.hidden { display: none; }
.request-form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.hint { font-size: 12px; color: var(--text-muted); text-align: center; }

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}
.name { font-weight: 600; }
.status { font-size: 12px; color: var(--success); }

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
    animation: fadeIn 0.2s;
    word-wrap: break-word;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } }

.message.own {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.message.other {
    align-self: flex-start;
    background: var(--bg-input);
    border-bottom-left-radius: 4px;
}

.message .text { white-space: pre-wrap; }
.message .meta { font-size: 11px; opacity: 0.7; margin-top: 4px; text-align: right; }

.message img.media, .message video.media {
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
    display: block;
}

.message audio { max-width: 240px; }

.chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-input input[type="text"] {
    flex: 1;
    border-radius: 24px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-input); color: var(--text); }

.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-send:hover { background: var(--primary-dark); transform: scale(1.05); }

.delete-settings {
    padding: 8px 16px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.delete-settings select { padding: 4px 8px; font-size: 12px; }

.media-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    padding: 20px;
}
.media-overlay img, .media-overlay video {
    max-width: 95%;
    max-height: 95%;
    border-radius: 10px;
}

/* Admin */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }
.admin-container header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.admin-container section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.admin-container h2 { margin-bottom: 16px; font-size: 18px; }

.create-user form { display: flex; gap: 12px; flex-wrap: wrap; }
.create-user input { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 13px; text-transform: uppercase; }
code { background: var(--bg-input); padding: 3px 8px; border-radius: 6px; font-size: 13px; }

.btn-logout {
    color: var(--danger);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 640px) {
    .landing-card { padding: 30px 24px; }
    .message { max-width: 85%; }
    .chat-container { max-width: 100%; }
}