* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif !important;
}

@import url('./fonts/yekan.css');

@font-face {
    font-family: 'Yekan';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/yekan-font@v2.0.0/dist/font-face/Yekan.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/yekan-font@v2.0.0/dist/font-face/Yekan.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    direction: rtl;
}

/* Force Yekan font on all elements */
* {
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif !important;
}
    direction: rtl;
}

.screen {
    display: none;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* Auth Screen */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
}

.auth-container h1 {
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.form-container {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
}

.form-container.active {
    display: block;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.form-container button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.form-container button:hover {
    background: #5a6fd8;
}

.form-container p {
    text-align: center;
    margin-top: 1rem;
}

.form-container a {
    color: #667eea;
    text-decoration: none;
}

/* Main App */
.app-container {
    display: flex;
    height: 100vh;
    background: white;
}

.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    background: #667eea;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#logoutBtn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.search-section {
    padding: 1rem;
    position: relative;
}

.search-section input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.tabs {
    display: flex;
    background: #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.tab-btn.active {
    background: white;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.chats-list, .files-list {
    padding: 0;
}

.chat-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.chat-item:hover {
    background: #f8f9fa;
}

.chat-item.active {
    background: #e3f2fd;
}

.chat-user-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.chat-last-message {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.chat-time {
    color: #999;
    font-size: 12px;
    position: absolute;
    top: 15px;
    left: 15px;
}

.files-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#uploadBtn {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.file-size {
    color: #666;
    font-size: 12px;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.file-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

.download-btn {
    background: #007bff;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.welcome-screen {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #666;
}

.welcome-screen.active {
    display: flex;
}

.chat-screen {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chat-screen.active {
    display: flex;
}

.chat-header {
    padding: 1rem;
    background: #667eea;
    color: white;
}

.typing-indicator {
    font-size: 12px;
    color: #ccc;
}

.messages-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.own {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message.own .message-bubble {
    background: #667eea;
    color: white;
}

.message:not(.own) .message-bubble {
    background: white;
    border: 1px solid #e9ecef;
}

.message-content {
    word-wrap: break-word;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    margin-top: 5px;
}

.message-image, .message-video {
    max-width: 200px;
    border-radius: 5px;
    margin-top: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.message-input-area {
    display: flex;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.attach-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

#messageInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

#sendBtn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Yekan', 'Tahoma', 'Arial', sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40%;
    }
    
    .chat-area {
        height: 60%;
    }
}.file-
item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:hover {
    background: #f8f9fa;
}

/* Message animations */
.message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Online status indicator */
.user-online {
    position: relative;
}

.user-online::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    top: 0;
    right: 0;
    border: 2px solid white;
}

/* Improved message bubbles */
.message-bubble {
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
}

.message.own .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #667eea;
    border-right: 0;
    border-bottom: 0;
    margin-top: -4px;
    margin-right: -8px;
}

.message:not(.own) .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: white;
    border-left: 0;
    border-bottom: 0;
    margin-top: -4px;
    margin-left: -8px;
}

/* Scroll improvements */
.messages-container {
    scroll-behavior: smooth;
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}