anycoder-70d45f77 / index.html
samirerty's picture
Upload folder using huggingface_hub
5059bfc verified
raw
history blame
30.7 kB
<?php
session_start();
// Database configuration
$db_host = 'localhost';
$db_name = 'minimal_chat';
$db_user = 'root';
$db_pass = '';
try {
$pdo = new PDO(
"mysql:host=$db_host;dbname=$db_name;charset=utf8mb4",
$db_user,
$db_pass,
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false
]
);
} catch (PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
// Get current user if logged in
$currentUser = null;
if (isset($_SESSION['user_id'])) {
$stmt = $pdo->prepare("SELECT id, name, phone, avatar_color FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$currentUser = $stmt->fetch();
}
// Enhanced Stickers configuration with requested additions
$stickers = [
'smile' => '😊', 'laugh' => '😂', 'heart' => '❤️', 'like' => '👍',
'dislike' => '👎', 'fire' => '🔥', 'clap' => '👏', 'party' => '🎉',
'star' => '⭐', 'cool' => '😎', 'think' => '🤔', 'sad' => '😢',
'angry' => '😠', 'wow' => '😲', 'ok' => '👌', 'pray' => '🙏',
'rocket' => '🚀', 'moon' => '🌙', 'sun' => '☀️', 'cloud' => '☁️',
'checkmark' => '✅', 'arrow' => '➡️', 'sparkles' => '✨', 'zap' => '⚡',
'rose' => '🌹', 'coffee' => '☕', 'music' => '🎵', 'book' => '📚'
];
?>
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<title>پیام رسان مینیمال</title>
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
<!-- Font Awesome Icons with requested additions -->
<style>
@font-face {
font-family: 'FontAwesome';
src: url("data:font/woff2;charset=utf-8;base64,d09GMgABAAAAA...") format('woff2');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Existing Icons */
.fa-comments:before { content: "\f086"; }
.fa-plus:before { content: "\f067"; }
.fa-arrow-right-from-bracket:before { content: "\f08b"; }
.fa-bars:before { content: "\f0c9"; }
.fa-arrow-right:before { content: "\f061"; }
.fa-hashtag:before { content: "\f292"; }
.fa-share-nodes:before { content: "\f1e0"; }
.fa-paper-plane:before { content: "\f1d8"; }
.fa-xmark:before { content: "\f00d"; }
.fa-chevron-left:before { content: "\f053"; }
.fa-check-circle:before { content: "\f058"; }
.fa-exclamation-circle:before { content: "\f06a"; }
.fa-info-circle:before { content: "\f05a"; }
.fa-trash:before { content: "\f1f8"; }
.fa-edit:before { content: "\f044"; }
.fa-user:before { content: "\f007"; }
.fa-image:before { content: "\f03e"; }
.fa-smile:before { content: "\f118"; }
.fa-save:before { content: "\f0c7"; }
.fa-close:before { content: "\f00d"; }
.fa-sticky-note:before { content: "\f249"; }
.fa-users:before { content: "\f0c0"; }
.fa-gear:before { content: "\f013"; }
.fa-camera:before { content: "\f030"; }
/* Requested New Icons */
.fa-search:before { content: "\f002"; }
.fa-bell:before { content: "\f0f3"; }
.fa-check:before { content: "\f00c"; }
.fa-arrow-left:before { content: "\f060"; }
.fa-home:before { content: "\f015"; }
.fa-ellipsis-v:before { content: "\f142"; }
</style>
<!-- Enhanced Glassmorphism CSS -->
<style>
/* CSS Variables for Glass Theme */
:root {
--glass-bg: rgba(255, 255, 255, 0.08);
--glass-bg-hover: rgba(255, 255, 255, 0.12);
--glass-bg-active: rgba(255, 255, 255, 0.15);
--glass-border: rgba(255, 255, 255, 0.18);
--glass-border-light: rgba(255, 255, 255, 0.08);
--glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
--glass-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.2);
--blur-amount: 16px;
--blur-heavy: 24px;
--gradient-start: #1e1b4b;
--gradient-mid: #312e81;
--gradient-end: #1e1b4b;
--accent-blue: #3b82f6;
--accent-indigo: #6366f1;
--text-primary: rgba(255, 255, 255, 0.95);
--text-secondary: rgba(255, 255, 255, 0.7);
--text-muted: rgba(255, 255, 255, 0.5);
}
/* Reset and Base */
*, ::before, ::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb;
}
body {
font-family: 'Vazirmatn', 'Tahoma', sans-serif;
background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
background-attachment: fixed;
-webkit-tap-highlight-color: transparent;
margin: 0;
padding: 0;
color: var(--text-primary);
overflow: hidden;
}
/* Enhanced Glass Panel - Multi-layered */
.glass-panel {
background: linear-gradient(135deg,
rgba(255, 255, 255, 0.1) 0%,
rgba(255, 255, 255, 0.05) 100%);
backdrop-filter: blur(var(--blur-amount)) saturate(180%);
-webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
border: 1px solid var(--glass-border);
box-shadow: var(--glass-shadow),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
position: relative;
overflow: hidden;
}
.glass-panel::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg,
rgba(255, 255, 255, 0.1) 0%,
transparent 50%,
rgba(255, 255, 255, 0.05) 100%);
pointer-events: none;
z-index: 0;
}
/* Glass Card - For modals and elevated surfaces */
.glass-card {
background: rgba(30, 27, 75, 0.6);
backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
-webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
border: 1px solid var(--glass-border);
border-radius: 1.5rem;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
/* Glass Button Variants */
.glass-button {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
color: white;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.glass-button::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s;
}
.glass-button:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3);
transform: translateY(-1px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.glass-button:hover::before {
left: 100%;
}
.glass-button:active {
transform: translateY(0);
background: rgba(255, 255, 255, 0.15);
}
/* Glass Input Fields */
.input-minimal {
background: rgba(255, 255, 255, 0.03);
border: 1px solid transparent;
border-bottom: 2px solid rgba(255, 255, 255, 0.15);
transition: all 0.3s ease;
backdrop-filter: blur(4px);
}
.input-minimal:focus {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.3);
border-bottom-color: var(--accent-blue);
box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
outline: none;
}
/* Enhanced Message Bubbles with Glass Effect */
.message-bubble-me {
background: linear-gradient(135deg,
rgba(59, 130, 246, 0.9) 0%,
rgba(37, 99, 235, 0.9) 100%);
backdrop-filter: blur(10px);
border-radius: 20px 20px 4px 20px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3),
inset 0 1px 0 rgba(255, 255, 255, 0.2);
position: relative;
}
.message-bubble-other {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px 20px 20px 4px;
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
/* Glass Avatar */
.glass-avatar {
background: linear-gradient(135deg,
rgba(255, 255, 255, 0.15) 0%,
rgba(255, 255, 255, 0.05) 100%);
backdrop-filter: blur(10px);
border: 2px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
inset 0 2px 4px rgba(255, 255, 255, 0.1);
}
/* Icon Button Glass Style */
.icon-button-glass {
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.15);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
color: rgba(255, 255, 255, 0.8);
}
.icon-button-glass:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3);
transform: scale(1.1) rotate(5deg);
box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}
/* Sticker Picker Enhanced */
.sticker-picker {
position: absolute;
bottom: 80px;
left: 10px;
right: 10px;
background: rgba(20, 20, 40, 0.85);
backdrop-filter: blur(30px) saturate(180%);
-webkit-backdrop-filter: blur(30px) saturate(180%);
border-radius: 24px;
padding: 20px;
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 12px;
max-height: 250px;
overflow-y: auto;
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
z-index: 100;
}
.sticker-item {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
font-size: 26px;
cursor: pointer;
border-radius: 12px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid transparent;
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.sticker-item:hover {
background: rgba(255, 255, 255, 0.15);
border-color: rgba(255, 255, 255, 0.3);
transform: scale(1.2) translateY(-2px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
/* Animations */
.fade-in {
animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(15px) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.message-enter {
animation: messagePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes messagePop {
0% {
opacity: 0;
transform: scale(0.6) translateY(30px) rotate(-5deg);
}
70% {
transform: scale(1.05) translateY(-5px) rotate(2deg);
}
100% {
opacity: 1;
transform: scale(1) translateY(0) rotate(0);
}
}
/* Shimmer Effect for Loading */
.shimmer {
background: linear-gradient(90deg,
rgba(255,255,255,0) 0%,
rgba(255,255,255,0.1) 50%,
rgba(255,255,255,0) 100%);
background-size: 200% 100%;
animation: shimmer 2s infinite;
}
@keyframes shimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
/* Gradient Text */
.gradient-text {
background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.m-0 { margin: 0; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.text-center { text-align: center; }
.text-white { color: white; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: bold; }
.font-medium { font-weight: 500; }
.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.3s; }
.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-50 { z-index: 50; }
.z-40 { z-index: 40; }
.z-30 { z-index: 30; }
.bg-white { background-color: white; }
.bg-blue-600 { background-color: #2563eb; }
.bg-slate-900 { background-color: #0f172a; }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
/* Mobile Sidebar */
@media (max-width: 768px) {
.mobile-sidebar {
position: fixed;
top: 0;
right: 0;
height: 100vh;
width: 85%;
max-width: 320px;
z-index: 40;
transform: translateX(100%);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}
.mobile-sidebar.open {
transform: translateX(0);
}
.sidebar-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
z-index: 35;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s;
}
.sidebar-overlay.active {
opacity: 1;
pointer-events: auto;
}
}
/* Desktop Styles */
@media (min-width: 769px) {
.mobile-sidebar {
position: relative;
transform: none;
width: 320px;
border-left: 1px solid rgba(255, 255, 255, 0.1);
}
}
/* Enhanced Scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.03);
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
border-radius: 4px;
border: 2px solid transparent;
background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3);
}
/* Toast Notification Glass Style */
.toast-glass {
background: rgba(30, 27, 75, 0.9);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
/* Room Item Hover Effect */
.room-item {
position: relative;
overflow: hidden;
transition: all 0.3s ease;
}
.room-item::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 3px;
background: linear-gradient(to bottom, var(--accent-blue), var(--accent-indigo));
opacity: 0;
transition: opacity 0.3s;
}
.room-item:hover::before {
opacity: 1;
}
/* Send Button Animation */
.send-button {
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
transition: all 0.3s ease;
}
.send-button:hover {
transform: scale(1.1) rotate(-5deg);
box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}
.send-button:active {
transform: scale(0.95);
}
/* Floating Animation */
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
.floating {
animation: float 3s ease-in-out infinite;
}
/* Pulse Glow */
@keyframes pulse-glow {
0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.6); }
}
.pulse-glow {
animation: pulse-glow 2s infinite;
}
</style>
</head>
<body class="text-white h-screen overflow-hidden bg-slate-900">
<!-- Toast Container -->
<div id="toast-container" class="fixed top-4 left-1/2 transform -translate-x-1/2 z-50 flex flex-col gap-2 w-full max-w-sm px-4 pointer-events-none">
</div>
<?php if (!$currentUser): ?>
<!-- Auth View -->
<div id="auth-view" class="h-full w-full flex items-center justify-center p-4 overflow-y-auto relative">
<!-- Decorative Elements -->
<div class="absolute top-20 left-20 w-72 h-72 bg-blue-500/20 rounded-full blur-3xl pointer-events-none"></div>
<div class="absolute bottom-20 right-20 w-96 h-96 bg-indigo-500/20 rounded-full blur-3xl pointer-events-none"></div>
<div class="glass-card p-6 md:p-8 rounded-2xl w-full max-w-md fade-in relative z-10">
<div class="text-center mb-8">
<div class="w-20 h-20 glass-avatar rounded-full mx-auto flex items-center justify-center mb-4 floating">
<i class="fa fa-comments text-3xl gradient-text"></i>
</div>
<h1 class="text-3xl font-bold gradient-text mb-2">پیام رسان مینیمال</h1>
<p class="text-white/60 text-sm">ورود به حساب کاربری</p>
</div>
<!-- Tabs -->
<div class="flex gap-4 mb-8 border-b border-white/10 pb-1">
<button onclick="switchAuthTab('login')" id="tab-login" class="flex-1 pb-3 text-sm font-medium border-b-2 border-white text-white transition-all">ورود</button>
<button onclick="switchAuthTab('register')" id="tab-register" class="flex-1 pb-3 text-sm font-medium border-b-2 border-transparent text-white/50 transition-all hover:text-white/70">ثبت نام</button>
</div>
<!-- Login Form -->
<form id="login-form" class="space-y-5" onsubmit="return handleLogin(event)">
<div class="relative">
<label class="block text-xs text-white/60 mb-2 flex items-center gap-2">
<i class="fa fa-user text-xs"></i> شماره موبایل
</label>
<input type="tel" id="login-phone" placeholder="09123456789" class="w-full input-minimal py-3 px-4 text-white rounded-lg" required>
</div>
<div class="relative">
<label class="block text-xs text-white/60 mb-2 flex items-center gap-2">
<i class="fa fa-gear text-xs"></i> رمز عبور
</label>
<input type="password" id="login-password" placeholder="••••••••" class="w-full input-minimal py-3 px-4 text-white rounded-lg" required>
</div>
<button type="submit" class="w-full glass-button py-3 rounded-xl mt-6 font-bold text-white shadow-lg">
ورود به حساب
</button>
</form>
<!-- Register Form -->
<form id="register-form" class="space-y-5 hidden" onsubmit="return handleRegister(event)">
<div>
<label class="block text-xs text-white/60 mb-2 flex items-center gap-2">
<i class="fa fa-user text-xs"></i> نام کامل
</label>
<input type="text" id="reg-name" placeholder="نام شما" class="w-full input-minimal py-3 px-4 text-white rounded-lg" required>
</div>
<div>
<label class="block text-xs text-white/60 mb-2 flex items-center gap-2">
<i class="fa fa-bell text-xs"></i> شماره موبایل
</label>
<input type="tel" id="reg-phone" placeholder="09123456789" class="w-full input-minimal py-3 px-4 text-white rounded-lg" required>
</div>
<div>
<label class="block text-xs text-white/60 mb-2 flex items-center gap-2">
<i class="fa fa-check text-xs"></i> رمز عبور
</label>
<input type="password" id="reg-password" placeholder="حداقل ۴ کاراکتر" class="w-full input-minimal py-3 px-4 text-white rounded-lg" required>
</div>
<button type="submit" class="w-full glass-button py-3 rounded-xl mt-6 font-bold text-white shadow-lg pulse-glow">
ثبت نام
</button>
</form>
</div>
</div>
<?php else: ?>
<!-- Dashboard View -->
<div id="dashboard-view" class="h-full w-full flex">
<!-- Sidebar -->
<aside id="sidebar" class="mobile-sidebar glass-panel flex flex-col">
<!-- Profile -->
<div class="p-5 border-b border-white/10 flex items-center justify-between glass-panel">
<div class="flex items-center gap-3 flex-1">
<div class="w-12 h-12 glass-avatar rounded-full flex items-center justify-center text-blue-300 font-bold text-lg relative overflow-hidden">
<span id="user-avatar-initial"><?php echo substr($currentUser['name'], 0, 1); ?></span>
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-400 rounded-full border-2 border-slate-900"></div>
</div>
<div class="flex-1 min-w-0">
<h2 id="user-name-display" class="font-bold text-sm truncate"><?php echo htmlspecialchars($currentUser['name']); ?></h2>
<p id="user-phone-display" class="text-xs text-white/50"><?php echo htmlspecialchars($currentUser['phone']); ?></p>
</div>
</div>
<button onclick="logout()" class="icon-button-glass">
<i class="fa fa-arrow-right-from-bracket text-sm"></i>
</button>
</div>
<!-- Create Room -->
<div class="p-5 border-b border-white/10 glass-panel">
<div class="flex justify-between items-center mb-4">
<span class="text-xs font-medium text-white/70 flex items-center gap-2">
<i class="fa fa-comments text-xs"></i> اتاق‌های من
</span>
<span id="room-count-badge" class="text-xs bg-white/10 px-3 py-1 rounded-full border border-white/10">۰/۳</span>
</div>
<button onclick="openCreateRoomModal()" id="btn-create-room" class="w-full py-3 border border-dashed border-white/30 rounded-xl text-sm text-white/80 hover:border-white/60 hover:text-white hover:bg-white/5 transition-all flex items-center justify-center gap-2">
<i class="fa fa-plus"></i> اتاق جدید
</button>
<p id="room-limit-msg" class="text-xs text-red-400 mt-3 hidden flex items-center gap-1">
<i class="fa fa-exclamation-circle"></i> حداکثر ۳ اتاق مجاز است
</p>
</div>
<!-- Room List -->
<div class="flex-1 overflow-y-auto p-3 space-y-2" id="room-list-container">
<div class="text-center mt-8 text-white/30 text-sm">
<i class="fa fa-comments text-4xl mb-3 opacity-30 block"></i>
<p>اتاقی وجود ندارد</p>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="flex-1 flex flex-col h-full relative">
<!-- Mobile Header -->
<header class="h-16 glass-panel border-b border-white/10 flex items-center justify-between px-4 md:hidden">
<button onclick="toggleSidebar()" class="icon-button-glass">
<i class="fa fa-bars text-sm"></i>
</button>
<span class="text-sm font-medium text-white/80 flex items-center gap-2">
<i class="fa fa-comments"></i> پیام رسان مینیمال
</span>
<div class="w-10"></div>
</header>
<!-- Desktop Header -->
<header class="hidden md:flex h-16 glass-panel border-b border-white/10 items-center justify-between px-6">
<div class="flex items-center gap-3">
<i class="fa fa-home text-white/40"></i>
<span class="text-sm font-medium text-white/60">داشبورد</span>
</div>
<div class="flex items-center gap-4">
<button class="icon-button-glass">
<i class="fa fa-search text-sm"></i>
</button>
<button class="icon-button-glass relative">
<i class="fa fa-bell text-sm"></i>
<span class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full text-[10px] flex items-center justify-center border-2 border-slate-900">3</span>
</button>
<div class="flex items-center gap-2 text-xs text-white/40 glass-button px-3 py-1.5 rounded-full">
<span class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></span>
آنلاین
</div>
</div>
</header>
<!-- Welcome Screen -->
<div id="welcome-screen" class="flex-1 flex flex-col items-center justify-center p-8 text-center relative overflow-hidden">
<div class="absolute inset-0 overflow-hidden pointer-events-none">
<div class="absolute top-1/4 left-1/4 w-64 h-64 bg-blue-500/10 rounded-full blur-3xl"></div>
<div class="absolute bottom-1/4 right-1/4 w-80 h-80 bg-indigo-500/10 rounded-full blur-3xl"></div>
</div>
<div class="w-24 h-24 glass-avatar rounded-full flex items-center justify-center mb-6 floating relative z-10">
<i class="fa fa-comments text-4xl text-white/60"></i>
</div>
<h2 class="text-2xl font-bold mb-3 relative z-10">به پیام رسان خوش آمدید</h2>
<p class="text-white/50 text-sm max-w-md mb-8 relative z-10">اتاق جدید بسازید یا یکی را انتخاب کنید</p>
<button onclick="openCreateRoomModal()" class="md:hidden glass-button px-8 py-3 rounded-full text-sm font-medium flex items-center gap-2 relative z-10">
<i class="fa fa-plus"></i> ساخت اتاق جدید
</button>
</div>
<!-- Chat Interface -->
<div id="chat-interface" class="hidden absolute inset-0 bg-slate-900 flex flex-col">
<!-- Chat Header -->
<div class="h-16 glass-panel border-b border-white/10 flex items-center justify-between px-4">
<div class="flex items-center gap-3 flex-1 min-w-0">
<button onclick="closeChat()" class="md:hidden icon-button-glass mr-2">
<i class="fa fa-arrow-right text-sm"></i>
</button>
<div class="w-10 h-10 glass-avatar rounded-full flex items-center justify-center shrink-0 cursor-pointer hover:scale-110 transition-transform" onclick="openRoomSettings()">
<i class="fa fa-hashtag text-sm text-indigo-300"></i>
</div>
<div class="min-w-0 flex-1">
<h3 id="chat-room-name" class="font-bold text-sm truncate">اتاق</h3>
<span id="chat-user-count" class="text-xs text-white/50 flex items-center gap-1">
<i class="fa fa-users text-[10px]"></i> ۲ عضو
</span>
</div>
</div>
<div class="flex items-center gap-2">
<button onclick="copyRoomLink()" class="icon-button-glass" title="اشتراک گذاری">
<i class="fa fa-share-nodes text-sm"></i>
</button>
<button onclick="deleteCurrentRoom()" class="icon-button-glass hover:border-red-400 hover:text-red-400" title="حذف اتاق">
<i class="fa fa-trash text-sm"></i>
</button>
</div>
</div>
<!-- Messages -->
<div id="messages-container" class="flex-1 overflow-y-auto p-4 space-y-4 relative">
<div class="absolute inset-0 pointer-events-none opacity-30">
<div class="absolute top-0 left-0 w-full h-20 bg-gradient-to-b from-slate-900 to-transparent"></div>
</div>
</div>
<!-- Input Area -->
<div class="p-4 glass-panel border-t border-white/10 relative">
<!-- Sticker Picker (Hidden by default) -->
<div id="sticker-picker" class="sticker-picker hidden">
<?php foreach ($stickers as $key => $sticker): ?>
<div class="sticker-item" onclick="addSticker('<?php echo $sticker; ?>')" title="<?php echo $key; ?>">
<?php echo $sticker; ?>
</div>
<?php endforeach; ?>
</div>
<form onsubmit="return sendMessage(event)" class="flex gap-3 items-center">
<button type="button" onclick="toggleStickerPicker()" class="icon-button-glass shrink-0">
<i class="fa fa-smile text-lg"></i>
</button>
<div class="flex-1 relative">
<input type="text" id="message-input" placeholder="پیام خود را بنویسید..."
class="w-full bg-white/5 border border-white/10 rounded-2xl px-5 py-3 text-sm text-white placeholder-white/30 focus:outline-none focus:bg-white/10 focus:border-white/30 transition-all"
autocomplete="off">
</div>
<button type="submit" class="send-button w-12 h-12 rounded-full flex items-center justify-center text-white shrink-0">
<i class="fa fa-paper-plane text-sm"></i>
</button>
</form>
</div>
</div>
</main>
</div>
<!-- Sidebar Overlay for Mobile -->
<div id="sidebar-overlay" class="sidebar-overlay md:hidden" onclick="toggleSidebar()"></div>
<!-- Create Room Modal -->
<div id="create-room-modal" class="fixed inset-0 z-50 hidden items-center justify-center p-4 bg-black/60 backdrop-blur-sm">
<div class="glass-card w-full max-w-sm rounded-2xl