/* Modern Telegram-Style Messenger */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0e1621;
    color: #333;
    font-size: 14px;
    min-height: 100vh;
}

.container {
    width: 100%;
    margin: 0;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

/* Header Styles - Telegram Style */
.header {
    background: #2b5278;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 0;
}

.header p {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}

.user-info {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 13px;
}

.user-info a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block;
    margin-left: 5px;
}

.user-info a:hover {
    background: rgba(255,255,255,0.15);
}

.user-info strong {
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 4px;
}

/* Content Area */
.content {
    padding: 0;
    max-width: 100%;
    background: #f4f4f5;
    min-height: calc(100vh - 60px);
}

/* Dashboard Layout - Telegram Style */
.dashboard-layout {
    display: flex;
    gap: 0;
    width: 100%;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 420px;
    min-width: 420px;
    background: white;
    padding: 0;
    height: 100%;
    border-right: 1px solid #e4e4e7;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    color: #707579;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    padding: 16px 20px 8px 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-box {
    padding: 8px 12px;
    background: white;
    border-bottom: 1px solid #e4e4e7;
}

.user-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.user-list::-webkit-scrollbar {
    width: 6px;
}

.user-list::-webkit-scrollbar-track {
    background: transparent;
}

.user-list::-webkit-scrollbar-thumb {
    background: #c4c9cc;
    border-radius: 3px;
}

.user-list li {
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.15s;
    cursor: pointer;
}

.user-list li:hover {
    background: #f4f4f5;
}

.user-list li a {
    color: #000;
    text-decoration: none;
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

.main-content {
    flex: 1;
    background: white;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-content h2 {
    color: #000;
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    padding: 20px 24px;
    border-bottom: 1px solid #e4e4e7;
    background: white;
}

/* User List with Avatar - Telegram Style */
.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.user-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-list-name {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 15px;
}

/* Chat Container - Telegram Style */
.chat-container {
    background: white;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
}

.chat-header {
    background: #2b5278;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.chat-header h2 {
    margin: 0 !important;
    font-size: 16px !important;
    color: white !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 500 !important;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info > div {
    flex: 1;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-status {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
    display: flex;
    align-items: center;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.online {
    background-color: #0ac630;
}

.status-indicator.offline {
    background-color: #a2acb4;
}

/* Chat Messages - Telegram Style */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0e1621 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%230e1621" width="100" height="100"/></svg>');
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.message {
    margin-bottom: 12px;
    display: flex;
    animation: slideIn 0.2s ease-out;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message > div {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
}

.message.sent > div {
    background: #2b5278;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received > div {
    background: white;
    color: #000;
    border-bottom-left-radius: 4px;
}

.message-header {
    margin-bottom: 4px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.message.sent .message-header strong {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.message.received .message-header strong {
    color: #2b5278;
    font-weight: 500;
}

.message-time {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
}

.message.received .message-time {
    color: #a2acb4;
}

.message-body {
    color: inherit;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Typing Indicator */
.typing-indicator {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
    margin-top: 2px;
}

.typing-indicator .dots {
    animation: blink 1.4s infinite;
}

@keyframes blink {
    0%, 20% { opacity: 0; }
    40% { opacity: 1; }
    60%, 100% { opacity: 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delete Button */
.delete-message-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 8px;
}

.delete-message-btn:hover {
    background: rgba(255,255,255,0.3);
}

.message.received .delete-message-btn {
    background: rgba(0,0,0,0.1);
    color: #000;
}

.message.received .delete-message-btn:hover {
    background: rgba(0,0,0,0.15);
}

/* Message Attachments */
.message-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-top: 6px;
    cursor: pointer;
    display: block;
}

.file-attachment {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    margin-top: 6px;
    transition: all 0.2s;
}

.file-attachment:hover {
    background: rgba(255,255,255,0.15);
}

/* Chat Input - Telegram Style */
.chat-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e4e4e7;
    flex-shrink: 0;
}

.chat-input form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e4e4e7;
    resize: none;
    min-height: 42px;
    max-height: 150px;
    font-family: inherit;
    font-size: 15px;
    border-radius: 21px;
    transition: all 0.2s;
    background: #f4f4f5;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #2b5278;
    background: white;
}

/* Buttons - Telegram Style */
.button {
    background: #2b5278;
    color: white;
    padding: 10px 24px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.2s;
}

.button:hover {
    background: #3d6a94;
}

.button:active {
    transform: scale(0.98);
}

.button-small {
    background: #2b5278;
    color: white;
    padding: 6px 14px;
    border: none;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: 500;
}

.button-small:hover {
    background: #3d6a94;
}

/* Form Styles */
.form-box {
    max-width: 420px;
    margin: 50px auto;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-box h2 {
    margin-bottom: 24px;
    color: #2b5278;
    font-size: 24px;
    font-weight: 500;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e4e4e7;
    background-color: #f4f4f5;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2b5278;
    background: white;
}

/* Messages */
.error {
    background: #ef4444;
    color: white;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.success {
    background: #10b981;
    color: white;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.info-box {
    background: #fbbf24;
    color: #78350f;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 8px;
    font-size: 14px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 16px 0;
}

.data-table th {
    background: #2b5278;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 13px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f1f1;
    background: white;
    font-size: 14px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f9fafb;
}

/* Unread Badge */
.unread-badge {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
    min-width: 18px;
    text-align: center;
}

/* Admin Navigation */
.admin-nav {
    background: white;
    border-bottom: 1px solid #e4e4e7;
    padding: 12px 20px;
}

.admin-nav a {
    color: #2b5278;
    text-decoration: none;
    margin-right: 24px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block;
    font-size: 14px;
}

.admin-nav a:hover {
    background: #f4f4f5;
}

/* Stats Box */
.stats-box {
    display: inline-block;
    background: white;
    padding: 20px;
    margin: 10px;
    min-width: 200px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.stats-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stats-box h3 {
    color: #707579;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-box .number {
    font-size: 36px;
    font-weight: 600;
    color: #2b5278;
}

/* Profile Page */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.profile-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

.profile-sidebar {
    width: 260px;
}

.profile-main {
    flex: 1;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.avatar-section {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

/* Search Box */
.search-box input,
.search-box select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e4e4e7;
    background: #f4f4f5;
    border-radius: 8px;
    font-size: 14px;
}

.select2-container--default .select2-selection--single {
    border: 1px solid #e4e4e7;
    height: 40px;
    padding: 4px;
    border-radius: 8px;
    background: #f4f4f5;
}

/* Welcome Box */
.welcome-box {
    text-align: center;
    padding: 48px 32px;
    background: white;
    margin: 50px auto;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.welcome-box h2 {
    color: #2b5278;
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .profile-layout {
        flex-direction: column;
    }
    
    .profile-sidebar {
        width: 100%;
    }
}

.container {
    width: 100%;
    margin: 0;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #6b7fa8 0%, #4a5f8f 100%);
    color: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}

.user-info {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 13px;
}

.user-info a {
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s;
    display: inline-block;
    background: rgba(255,255,255,0.1);
    margin-left: 5px;
}

.user-info a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.user-info strong {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

/* Content Area */
.content {
    padding: 30px 40px;
    max-width: 100%;
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
}

/* Form Box */
.form-box {
    max-width: 480px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.form-box h2 {
    margin-bottom: 30px;
    color: #4a5f8f;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6b7fa8;
    box-shadow: 0 0 0 3px rgba(107, 127, 168, 0.1);
}

/* Buttons */
.button {
    background: linear-gradient(135deg, #6b7fa8 0%, #4a5f8f 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(107, 127, 168, 0.3);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 127, 168, 0.4);
}

.button:active {
    transform: translateY(0);
}

.button-small {
    background: #6b7fa8;
    color: white;
    padding: 6px 15px;
    border: none;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    border-radius: 6px;
    transition: all 0.3s;
    cursor: pointer;
}

.button-small:hover {
    background: #5a6f98;
    transform: translateY(-1px);
}

/* Messages */
.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
}

.info-box {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb800 100%);
    color: #333;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.text-center {
    text-align: center;
    margin-top: 20px;
}

/* Welcome Box */
.welcome-box {
    text-align: center;
    padding: 60px 40px;
    background: white;
    margin: 50px auto;
    max-width: 700px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.welcome-box h2 {
    color: #4a5f8f;
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: 600;
}

.button-group {
    margin-top: 30px;
}

.button-group .button {
    margin: 0 10px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    gap: 25px;
    width: 100%;
}

.sidebar {
    width: 300px;
    min-width: 300px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sidebar h3 {
    color: #4a5f8f;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #6b7fa8;
}

.user-list {
    list-style: none;
}

.user-list li {
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.user-list li:hover {
    background: #f8f9fa;
}

.user-list li a {
    color: #333;
    text-decoration: none;
    padding: 12px;
    display: flex;
    align-items: center;
    border-radius: 8px;
}

.user-list li a:hover {
    color: #4a5f8f;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.main-content h2 {
    color: #4a5f8f;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #6b7fa8;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.data-table th {
    background: linear-gradient(135deg, #6b7fa8 0%, #4a5f8f 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f8f9fa;
}

/* Chat Container */
.chat-container {
    background: white;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.chat-header {
    background: linear-gradient(135deg, #6b7fa8 0%, #4a5f8f 100%);
    color: white;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header h2 {
    margin: 0 !important;
    font-size: 20px !important;
    color: white !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 500 !important;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-info > div {
    flex: 1;
}

.chat-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-status {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.status-indicator.online {
    background-color: #51cf66;
    box-shadow: 0 0 10px #51cf66;
}

.status-indicator.offline {
    background-color: #adb5bd;
}

/* Chat Messages */
.chat-messages {
    height: 550px;
    overflow-y: auto;
    padding: 25px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #6b7fa8;
    border-radius: 4px;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease-out;
}

.message.sent {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #6b7fa8;
}

.message.received {
    background: white;
    border-left: 4px solid #adb5bd;
}

.message-header {
    margin-bottom: 8px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-header strong {
    color: #4a5f8f;
    font-weight: 600;
}

.message-time {
    color: #868e96;
    font-size: 11px;
}

.message-body {
    color: #333;
    line-height: 1.6;
}

/* Typing Indicator */
.typing-indicator {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    font-style: italic;
    margin-top: 5px;
}

.typing-indicator .dots {
    animation: blink 1.4s infinite;
}

@keyframes blink {
    0%, 20% { opacity: 0; }
    40% { opacity: 1; }
    60%, 100% { opacity: 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delete Button */
.delete-message-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.3s;
}

.delete-message-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* Message Attachments */
.message-image {
    max-width: 350px;
    max-height: 350px;
    border-radius: 10px;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.file-attachment {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    margin-top: 10px;
    transition: all 0.3s;
}

.file-attachment:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Chat Input */
.chat-input {
    padding: 20px 25px;
    background: white;
    border-top: 2px solid #f0f0f0;
}

.chat-input form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    font-family: inherit;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #6b7fa8;
    box-shadow: 0 0 0 3px rgba(107, 127, 168, 0.1);
}

/* Admin Navigation */
.admin-nav {
    background: white;
    border-bottom: 2px solid #f0f0f0;
    padding: 15px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-nav a {
    color: #4a5f8f;
    text-decoration: none;
    margin-right: 30px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s;
    display: inline-block;
}

.admin-nav a:hover {
    background: #f8f9fa;
    color: #3a4f7f;
}

/* Stats Box */
.stats-box {
    display: inline-block;
    background: white;
    padding: 25px;
    margin: 10px;
    min-width: 220px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.stats-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stats-box h3 {
    color: #4a5f8f;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-box .number {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #6b7fa8 0%, #4a5f8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.select2-container--default .select2-selection--single {
    border: 2px solid #e0e0e0;
    height: 42px;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #6b7fa8;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* Unread Badge */
.unread-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* User List with Avatar */
.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.user-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6b7fa8;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-list-name {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

/* Profile Page */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.profile-sidebar {
    width: 280px;
}

.profile-main {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.avatar-section {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.profile-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #6b7fa8;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(107, 127, 168, 0.3);
}

/* Footer */
.footer {
    background: white;
    border-top: 2px solid #f0f0f0;
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #868e96;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .profile-layout {
        flex-direction: column;
    }
    
    .profile-sidebar {
        width: 100%;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .user-info {
        position: static;
        margin-top: 15px;
    }
}


/* Telegram-Style Unified Layout */
.telegram-layout {
    background: #0e1621;
    overflow: hidden;
}

.telegram-container {
    display: flex;
    height: 100vh;
    max-width: 100%;
    position: relative;
}

/* Settings Sidebar */
.settings-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 320px;
    height: 100vh;
    background: #212121;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.settings-sidebar.active {
    left: 0;
}

.settings-header {
    padding: 16px;
    background: #2b5278;
    display: flex;
    align-items: center;
    gap: 16px;
}

.close-settings {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.settings-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.settings-content {
    padding: 16px;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 20px;
}

.profile-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card-info {
    flex: 1;
}

.profile-card-name {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.profile-card-status {
    color: #707579;
    font-size: 14px;
}

.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.settings-item:hover {
    background: #2a2a2a;
}

.settings-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Sidebar */
.telegram-sidebar {
    width: 340px;
    background: #212121;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #181818;
}

.sidebar-header {
    padding: 10px 12px;
    background: #212121;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #181818;
}

.menu-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.08);
}

.search-input {
    flex: 1;
    background: #181818;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
}

.search-input::placeholder {
    color: #707579;
}

.search-input:focus {
    outline: none;
    background: #2a2a2a;
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid #181818;
    transition: all 0.15s;
    cursor: pointer;
}

.conversation-item:hover {
    background: #2a2a2a;
}

.conversation-item.active {
    background: #2b5278;
}

.conv-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conv-name {
    font-weight: 500;
    font-size: 15px;
    color: #fff;
}

.conv-time {
    font-size: 12px;
    color: #707579;
}

.conv-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-message {
    font-size: 14px;
    color: #707579;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conv-badge {
    background: #2b5278;
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Chat Area */
.telegram-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0e1621;
}

.chat-header-telegram {
    background: #212121;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #181818;
}

.header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.header-info {
    flex: 1;
}

.header-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.header-status {
    font-size: 13px;
    color: #707579;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.08);
}

/* Messages - Telegram Style */
.chat-messages-telegram {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #0e1621;
}

.chat-messages-telegram::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-telegram::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-telegram::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.message-telegram {
    display: flex;
    gap: 6px;
    animation: messageSlideIn 0.15s ease-out;
    margin-bottom: 2px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-telegram.outgoing {
    justify-content: flex-end;
    padding-right: 8px;
}

.message-telegram.incoming {
    justify-content: flex-start;
    padding-left: 8px;
}

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    align-self: flex-end;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 420px;
    min-width: 80px;
    padding: 6px 10px 4px 10px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.message-telegram.outgoing .message-bubble {
    background: #2b5278;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.message-telegram.incoming .message-bubble {
    background: #1c2733;
    color: #fff;
    border-bottom-left-radius: 3px;
}

.message-bubble:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.bubble-text {
    font-size: 15px;
    line-height: 1.35;
    word-wrap: break-word;
    margin-bottom: 2px;
    color: #fff;
    white-space: pre-wrap;
}

.bubble-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: -2px -6px 2px -6px;
    cursor: pointer;
    transition: all 0.2s;
}

.bubble-image:hover {
    opacity: 0.95;
}

/* Lightbox Controls */
.lightbox-controls {
    display: flex;
    gap: 10px;
}

.lightbox-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.lightbox-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.lightbox-btn:active {
    transform: scale(0.95);
}

.lightbox-btn svg {
    width: 24px;
    height: 24px;
}

.bubble-file {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    padding: 4px 0;
    margin-bottom: 2px;
}

.bubble-file:hover {
    opacity: 0.9;
}

.bubble-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    min-height: 16px;
}

.bubble-time {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
    letter-spacing: 0.2px;
}

.message-telegram.incoming .bubble-time {
    color: rgba(255,255,255,0.4);
}

.message-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
    position: relative;
    width: 20px;
    height: 16px;
}

.message-status svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    position: absolute;
    top: 0;
}

.message-status.sent {
    color: rgba(255,255,255,0.5);
    width: 16px;
}

.message-status.sent svg {
    position: static;
}

.message-status.delivered {
    color: rgba(255,255,255,0.5);
}

.message-status.delivered svg:first-child {
    left: 0;
}

.message-status.delivered svg:last-child {
    left: 6px;
}

.message-status.read {
    color: #34c759;
}

.message-status.read svg:first-child {
    left: 0;
}

.message-status.read svg:last-child {
    left: 6px;
}

.message-telegram.incoming .message-status {
    display: none;
}

.bubble-delete {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: all 0.2s;
    line-height: 1;
    margin-left: 4px;
    opacity: 0;
}

.message-bubble:hover .bubble-delete {
    opacity: 1;
}

.bubble-delete:hover {
    color: rgba(255,255,255,0.7);
    transform: scale(1.1);
}

/* Chat Input */
.chat-input-telegram {
    padding: 12px 16px;
    background: #212121;
    border-top: 1px solid #181818;
}

.chat-input-telegram form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.attach-btn {
    background: none;
    border: none;
    color: #707579;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.attach-btn:hover {
    background: rgba(255,255,255,0.08);
}

.chat-input-telegram textarea {
    flex: 1;
    background: #181818;
    border: none;
    padding: 10px 14px;
    border-radius: 20px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
}

.chat-input-telegram textarea::placeholder {
    color: #707579;
}

.chat-input-telegram textarea:focus {
    outline: none;
    background: #2a2a2a;
}

.send-btn {
    background: #2b5278;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #3d6a94;
}

.send-btn:active {
    transform: scale(0.95);
}

/* Empty Chat State */
.empty-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #707579;
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-chat h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-chat p {
    color: #707579;
    font-size: 14px;
}

/* User Profile Sidebar */
.user-profile-sidebar {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: #212121;
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.user-profile-sidebar.active {
    right: 0;
}

.user-profile-sidebar::-webkit-scrollbar {
    width: 6px;
}

.user-profile-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.user-profile-sidebar::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.profile-sidebar-header {
    padding: 16px;
    background: #2b5278;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #181818;
}

.close-profile-sidebar {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
}

.close-profile-sidebar:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.profile-sidebar-title {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.profile-sidebar-content {
    flex: 1;
}

.profile-header-section {
    padding: 32px 24px;
    text-align: center;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.profile-large-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid #2b5278;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.profile-username {
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 8px;
}

.profile-status {
    color: #707579;
    font-size: 14px;
}

.profile-status.online {
    color: #4ade80;
}

.profile-info-section {
    padding: 0;
}

.profile-info-item {
    padding: 16px 24px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.profile-info-item:hover {
    background: #2a2a2a;
}

.profile-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2b5278;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.profile-info-content {
    flex: 1;
    min-width: 0;
}

.profile-info-label {
    color: #707579;
    font-size: 13px;
    margin-bottom: 4px;
}

.profile-info-value {
    color: #fff;
    font-size: 15px;
    word-break: break-word;
}

.profile-actions-section {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-action-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
}

.profile-action-btn:hover {
    background: #333;
    border-color: #2b5278;
}

.profile-action-btn.danger {
    color: #ff6b6b;
}

.profile-action-btn.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.profile-action-icon {
    font-size: 20px;
}

/* Overlay for profile sidebar */
.profile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.profile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Profile Action Buttons (Message & Mute) */
.profile-action-buttons {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: #17212b;
    border-bottom: 1px solid #0e1621;
}

.profile-main-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: #2b5278;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-main-btn:hover {
    background: #3a6a94;
    transform: translateY(-1px);
}

.profile-main-btn:active {
    transform: translateY(0);
}

.profile-main-btn .btn-icon {
    font-size: 24px;
}

.profile-main-btn .btn-label {
    font-size: 13px;
    font-weight: 500;
}

/* Profile Info Section Updates */
.profile-info-item {
    position: relative;
}

.profile-info-action {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #2b5278;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0.7;
}

.profile-info-action:hover {
    background: rgba(43, 82, 120, 0.1);
    opacity: 1;
}

/* Media Stats Section */
.profile-media-section {
    padding: 16px 20px;
    background: #17212b;
    border-bottom: 1px solid #0e1621;
}

.media-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.media-stat-item:last-child {
    border-bottom: none;
}

.media-stat-item:hover {
    background: rgba(43, 82, 120, 0.1);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.media-stat-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.media-stat-content {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.media-stat-count {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.media-stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

/* Muted State */
.profile-main-btn.muted {
    background: #d9534f;
}

.profile-main-btn.muted:hover {
    background: #c9302c;
}

/* Responsive */
@media (max-width: 768px) {
    .telegram-sidebar {
        width: 100%;
    }
    
    .telegram-chat {
        display: none;
    }
    
    .telegram-sidebar.hidden {
        display: none;
    }
    
    .telegram-chat.active {
        display: flex;
    }
    
    .user-profile-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Input Wrapper for Emoji Button */
.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #181818;
    border-radius: 20px;
}

.input-wrapper textarea {
    flex: 1;
    background: transparent !important;
    border-radius: 0 !important;
}

.emoji-btn {
    background: none;
    border: none;
    color: #707579;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
}

.emoji-btn:hover {
    transform: scale(1.1);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 50px;
    width: 350px;
    height: 400px;
    background: #212121;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.emoji-categories {
    display: flex;
    padding: 8px;
    gap: 4px;
    border-bottom: 1px solid #181818;
    overflow-x: auto;
}

.emoji-categories::-webkit-scrollbar {
    height: 4px;
}

.emoji-categories::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 2px;
}

.emoji-cat-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    opacity: 0.5;
}

.emoji-cat-btn:hover {
    background: #2a2a2a;
    opacity: 1;
}

.emoji-cat-btn.active {
    background: #2b5278;
    opacity: 1;
}

.emoji-grid {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    align-content: start;
}

.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.emoji-item {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.emoji-item:hover {
    background: #2a2a2a;
    transform: scale(1.2);
}

/* Search in Chat */
.search-in-chat {
    background: #2a2a2a;
    padding: 12px 16px;
    border-bottom: 1px solid #181818;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-chat-input {
    flex: 1;
    background: #181818;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.search-chat-input::placeholder {
    color: #707579;
}

.search-chat-input:focus {
    outline: none;
    background: #212121;
}

.close-search-btn {
    background: none;
    border: none;
    color: #707579;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-search-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.search-results-info {
    color: #707579;
    font-size: 12px;
    white-space: nowrap;
}

.message-telegram.search-highlight {
    animation: highlightPulse 0.5s ease;
}

.message-telegram.search-highlight .message-bubble {
    background: #3d6a94 !important;
    box-shadow: 0 0 10px rgba(61, 106, 148, 0.5);
}

@keyframes highlightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* Telegram-Style Admin & Profile Pages */
.telegram-page {
    background: #0e1621;
    min-height: 100vh;
}

.telegram-page .container {
    background: transparent;
    box-shadow: none;
}

.telegram-page .header {
    background: #212121;
    border-bottom: 1px solid #181818;
    padding: 12px 20px;
}

.telegram-page .header h1 {
    color: #fff;
    font-size: 20px;
    margin: 0;
}

.telegram-page .header p {
    color: #707579;
    font-size: 14px;
    margin: 4px 0 0 0;
}

.telegram-page .content {
    background: transparent;
    padding: 20px;
}

.telegram-card {
    background: #212121;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.telegram-card h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.telegram-card h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Admin Navigation - Telegram Style */
.telegram-page .admin-nav {
    background: #212121;
    border-bottom: 1px solid #181818;
    padding: 12px 20px;
    display: flex;
    gap: 8px;
}

.telegram-page .admin-nav a {
    color: #fff;
    background: #2a2a2a;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.telegram-page .admin-nav a:hover {
    background: #2b5278;
}

/* Data Table - Telegram Style */
.telegram-page .data-table {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.telegram-page .data-table th {
    background: #2a2a2a;
    color: #fff;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 13px;
    border: none;
}

.telegram-page .data-table td {
    background: #212121;
    color: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 14px;
}

.telegram-page .data-table tr:hover td {
    background: #2a2a2a;
}

/* Stats Box - Telegram Style */
.telegram-page .stats-box {
    background: #212121;
    border: 1px solid #2a2a2a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.telegram-page .stats-box h3 {
    color: #707579;
}

.telegram-page .stats-box .number {
    color: #2b5278;
}

/* Profile Page - Telegram Style */
.telegram-page .profile-layout {
    gap: 20px;
}

.telegram-page .profile-sidebar,
.telegram-page .profile-main {
    background: #212121;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.telegram-page .avatar-section {
    background: #212121;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.telegram-page .form-group label {
    color: #fff;
}

.telegram-page .form-group input,
.telegram-page .form-group textarea,
.telegram-page .form-group select {
    background: #181818;
    border: 1px solid #2a2a2a;
    color: #fff;
}

.telegram-page .form-group input:focus,
.telegram-page .form-group textarea:focus,
.telegram-page .form-group select:focus {
    background: #212121;
    border-color: #2b5278;
}

/* Sessions List - Telegram Style */
.telegram-page .session-item {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
}

.telegram-page .session-item:hover {
    border-color: #2b5278;
}

.telegram-page .session-name {
    color: #fff;
}

.telegram-page .session-details,
.telegram-page .session-meta {
    color: #707579;
}

/* Messages */
.telegram-page .success {
    background: #1a472a;
    color: #4ade80;
    border: 1px solid #22543d;
}

.telegram-page .error {
    background: #4a1a1a;
    color: #f87171;
    border: 1px solid #7f1d1d;
}

.telegram-page .info-box {
    background: #4a3a1a;
    color: #fbbf24;
    border: 1px solid #78350f;
}

/* Buttons - Telegram Style */
.telegram-page .button {
    background: #2b5278;
}

.telegram-page .button:hover {
    background: #3d6a94;
}

.telegram-page .button-small {
    background: #2b5278;
}

.telegram-page .button-small:hover {
    background: #3d6a94;
}

/* Form Box - Telegram Style */
.telegram-page .form-box {
    background: #212121;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
}

.telegram-page .form-box h2 {
    color: #fff;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.telegram-page .text-center {
    color: #707579;
}

.telegram-page .text-center a {
    color: #2b5278;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.telegram-page .text-center a:hover {
    color: #3d6a94;
}

/* Welcome Box - Telegram Style */
.telegram-page .welcome-box {
    background: #212121;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
}

.telegram-page .welcome-box h2 {
    color: #fff;
}

.telegram-page .welcome-box p {
    color: #707579;
}


/* Chat Background Settings Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1e1e1e;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.close-modal {
    background: none;
    border: none;
    color: #aaa;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-modal:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.bg-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.bg-type-btn {
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: #fff;
}

.bg-type-btn:hover {
    border-color: #2b5278;
    background: #333;
}

.bg-type-btn.active {
    border-color: #2b5278;
    background: #2b5278;
}

.bg-icon {
    font-size: 32px;
}

.bg-option-panel {
    margin-top: 20px;
}

.bg-option-panel h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 15px;
}

.color-presets,
.gradient-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.color-preset,
.gradient-preset {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-preset:hover,
.gradient-preset:hover {
    border-color: #2b5278;
    transform: scale(1.1);
}

#customColor {
    width: 100%;
    height: 50px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    background: #2a2a2a;
    cursor: pointer;
}

#bgImageInput {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

#bgImageInput::-webkit-file-upload-button {
    background: #2b5278;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    margin-right: 12px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.button-secondary {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #3a3a3a;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}

.button-secondary:hover {
    background: #333;
}


/* Voice Recorder Styles - Telegram Style */
.voice-recorder-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #1e3a5f 0%, #2d4a6f 50%, #3d5a7f 100%);
    padding: 16px 20px;
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.voice-recorder-container.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-cancel-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-cancel-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.voice-cancel-btn:active {
    transform: scale(0.95);
}

.voice-recording-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.voice-recording-dot {
    width: 10px;
    height: 10px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.3);
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    }
}

.voice-timer {
    color: white;
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.voice-waveform {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    padding: 0 20px;
}

.voice-waveform-bar {
    width: 3px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255,255,255,0.3);
}

.voice-waveform-bar:nth-child(1) { height: 25%; animation-delay: 0s; }
.voice-waveform-bar:nth-child(2) { height: 45%; animation-delay: 0.1s; }
.voice-waveform-bar:nth-child(3) { height: 65%; animation-delay: 0.2s; }
.voice-waveform-bar:nth-child(4) { height: 85%; animation-delay: 0.3s; }
.voice-waveform-bar:nth-child(5) { height: 100%; animation-delay: 0.4s; }
.voice-waveform-bar:nth-child(6) { height: 85%; animation-delay: 0.5s; }
.voice-waveform-bar:nth-child(7) { height: 65%; animation-delay: 0.6s; }
.voice-waveform-bar:nth-child(8) { height: 45%; animation-delay: 0.7s; }
.voice-waveform-bar:nth-child(9) { height: 25%; animation-delay: 0.8s; }
.voice-waveform-bar:nth-child(10) { height: 45%; animation-delay: 0.9s; }

@keyframes wave {
    0%, 100% { 
        transform: scaleY(0.4);
        opacity: 0.6;
    }
    50% { 
        transform: scaleY(1);
        opacity: 1;
    }
}

.voice-send-btn {
    background: white;
    border: none;
    color: #2b5278;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.voice-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.voice-send-btn:active {
    transform: scale(0.95);
}

.voice-instruction {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}

/* Voice Message Bubble - Telegram Style */
.voice-message-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    min-width: 240px;
    max-width: 340px;
}

.voice-play-btn {
    background: #53a7e6;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding-left: 2px;
}

.voice-play-btn:hover {
    background: #4a9ad6;
    transform: scale(1.03);
}

.voice-play-btn:active {
    transform: scale(0.97);
}

.message-telegram.incoming .voice-play-btn {
    background: #53a7e6;
}

.message-telegram.incoming .voice-play-btn:hover {
    background: #4a9ad6;
}

.voice-download-btn {
    background: transparent;
    border: none;
    color: #707579;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    text-decoration: none;
    margin-left: 4px;
}

.voice-download-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2b5278;
}

.voice-download-btn:active {
    transform: scale(0.95);
}

.message-telegram.incoming .voice-download-btn {
    color: #fff;
}

.message-telegram.incoming .voice-download-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.voice-message-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

/* Voice Filename Display */
.voice-filename {
    font-size: 13px;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.3;
}

.message-telegram.incoming .voice-filename {
    color: rgba(255,255,255,0.9);
}

/* Voice Waveform Display */
.voice-waveform-display {
    display: flex;
    align-items: center;
    height: 22px;
    gap: 2px;
    cursor: pointer;
    position: relative;
}

.voice-waveform-display .waveform-bar {
    width: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 1px;
    transition: all 0.1s;
}

.message-telegram.incoming .voice-waveform-display .waveform-bar {
    background: rgba(255,255,255,0.35);
}

.voice-waveform-display .waveform-bar.active {
    background: #53a7e6;
}

.message-telegram.incoming .voice-waveform-display .waveform-bar.active {
    background: #53a7e6;
}

/* Voice Progress Bar - Simplified */
.voice-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.message-telegram.incoming .voice-progress-bar {
    background: rgba(255,255,255,0.15);
}

.voice-progress-fill {
    height: 100%;
    background: #53a7e6;
    border-radius: 1px;
    width: 0%;
    transition: width 0.1s linear;
}

.voice-time-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
    margin-top: -2px;
}

.message-telegram.incoming .voice-time-info {
    color: rgba(255,255,255,0.45);
}

.voice-duration {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.voice-file-size {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-left: 6px;
}

/* Microphone Button - Telegram Style */
.mic-btn {
    background: transparent;
    border: none;
    color: #8e8e93;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    width: 40px;
    height: 40px;
}

.mic-btn:hover {
    background: rgba(142, 142, 147, 0.12);
    color: #2b5278;
}

.mic-btn:active {
    transform: scale(0.92);
    background: rgba(142, 142, 147, 0.18);
}

.mic-btn.recording {
    color: #ff4444;
    animation: pulse-mic 1.2s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Hide send button when showing mic */
.chat-input-telegram.has-text .mic-btn {
    display: none;
}

.chat-input-telegram.has-text .send-btn {
    display: flex;
}

.chat-input-telegram:not(.has-text) .send-btn {
    display: none;
}

.chat-input-telegram:not(.has-text) .mic-btn {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .voice-recorder-container {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .voice-waveform {
        padding: 0 10px;
    }
    
    .voice-send-btn {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .voice-cancel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}


/* ============================================
   MEDIA PLAYER BAR (Telegram Style - Compact)
   ============================================ */

.media-player-bar {
    position: absolute;
    top: 60px; /* زیر هدر چت که 60px ارتفاع داره */
    left: 0; /* از ابتدای telegram-chat شروع می‌شود */
    right: 0; /* تا انتهای telegram-chat ادامه می‌یابد */
    height: 50px;
    background: linear-gradient(135deg, #2b5278 0%, #1e3a5f 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
}

.media-player-bar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Adjust chat messages when player is visible */
.media-player-bar.visible ~ .chat-messages-telegram {
    padding-top: 50px;
}

.player-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-btn,
.player-btn-prev,
.player-btn-next,
.player-btn-volume,
.player-btn-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.player-btn svg,
.player-btn-prev svg,
.player-btn-next svg,
.player-btn-volume svg,
.player-btn-close svg {
    width: 16px;
    height: 16px;
}

.player-btn:hover,
.player-btn-prev:hover,
.player-btn-next:hover,
.player-btn-volume:hover,
.player-btn-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.player-btn:active,
.player-btn-prev:active,
.player-btn-next:active,
.player-btn-volume:active,
.player-btn-close:active {
    transform: scale(0.95);
}

.player-btn-main {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.player-btn-main svg {
    width: 18px;
    height: 18px;
}

.player-btn-main:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.player-btn-main:active {
    transform: scale(0.95);
}

/* Player Info */
.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.player-title {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-time {
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    min-width: 32px;
    text-align: center;
}

.player-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.player-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.player-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 9px;
    height: 9px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: left 0.1s linear;
}

.player-progress-bar:hover .player-progress-handle {
    width: 11px;
    height: 11px;
}

/* Right Controls */
.player-right-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.player-volume-slider {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    padding: 10px 6px;
    border-radius: 6px;
    display: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.player-volume-slider input[type="range"] {
    width: 80px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
}

.player-volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.player-volume-slider input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#playerSpeedBtn {
    min-width: 36px;
    width: auto;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
}

/* Adjust chat messages area when player is visible */
.telegram-chat {
    position: relative;
}

.chat-messages-telegram {
    transition: padding-top 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .media-player-bar {
        left: 0; /* در موبایل از ابتدای صفحه شروع می‌شود */
        padding: 0 8px;
        height: 45px;
    }
    
    .media-player-bar.visible ~ .chat-messages-telegram {
        padding-top: 45px;
    }
    
    .player-bar-content {
        gap: 8px;
    }
    
    .player-controls {
        gap: 2px;
    }
    
    .player-btn,
    .player-btn-prev,
    .player-btn-next,
    .player-btn-volume,
    .player-btn-close {
        width: 26px;
        height: 26px;
    }
    
    .player-btn svg,
    .player-btn-prev svg,
    .player-btn-next svg,
    .player-btn-volume svg,
    .player-btn-close svg {
        width: 14px;
        height: 14px;
    }
    
    .player-btn-main {
        width: 30px;
        height: 30px;
    }
    
    .player-btn-main svg {
        width: 16px;
        height: 16px;
    }
    
    .player-title {
        font-size: 11px;
    }
    
    .player-time {
        font-size: 9px;
        min-width: 28px;
    }
    
    #playerSpeedBtn {
        display: none;
    }
    
    .player-volume-control {
        display: none;
    }
}

/* Animation for showing player bar */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-player-bar.visible {
    animation: slideDown 0.3s ease;
}


/* Drag and Drop Overlay */
.drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 82, 120, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-message {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 500;
    color: #2b5278;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* File Preview Modal (Telegram Style) */
.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.file-preview-modal.show {
    opacity: 1;
}

.file-preview-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.file-preview-modal.show .file-preview-content {
    transform: scale(1);
}

.file-preview-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-preview-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-preview {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-preview:hover {
    background: #f0f0f0;
    color: #333;
}

.file-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.file-preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.file-icon-large {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #e3f2fd;
    border-radius: 6px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.file-size {
    font-size: 12px;
    color: #999;
}

.file-caption-area {
    margin-top: 12px;
}

.file-caption-area textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}

.file-caption-area textarea:focus {
    outline: none;
    border-color: #2b5278;
}

.file-preview-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel, .btn-send {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-send {
    background: #2b5278;
    color: white;
}

.btn-send:hover {
    background: #1e3a5f;
}

/* Uploading Indicator */
.uploading-indicator {
    background: rgba(43, 82, 120, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 10px auto;
    text-align: center;
    color: #2b5278;
    font-size: 14px;
    max-width: 300px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}


/* Switch to Voice Mode Feedback */
.switch-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(43, 82, 120, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.switch-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Long press visual feedback */
.send-btn.long-pressing,
.mic-btn.long-pressing {
    transform: scale(0.95);
    opacity: 0.8;
}



/* Group Edit Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-modal-btn:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #2b5278;
}

.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2b5278;
    color: white;
}

.btn-primary:hover {
    background: #1e3a5f;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}
