@font-face {
    font-family: 'MainFont';
    src: url('../fonts/main.woff') format('woff'),
         url('../fonts/main.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: 'MainFont', Arial, sans-serif !important;
}

html, body {
    font-family: 'MainFont', Arial, sans-serif !important;
}

#app, #app * {
    font-family: 'MainFont', Arial, sans-serif !important;
}

.v-application,
.v-application *,
.v-application .headline,
.v-application .title, 
.v-application .subheading,
.v-application .body-2,
.v-application .body-1,
.v-application .caption,
.v-application .overline,
.v-application--wrap {
    font-family: 'MainFont', Arial, sans-serif !important;
}

.v-toolbar__title,
.v-btn,
.v-btn *,
.v-btn__content,
.v-input,
.v-input *,
.v-input input,
.v-input textarea,
.v-input__slot,
.v-text-field__slot input,
.v-select__slot input,
.v-list-item__title,
.v-list-item__subtitle,
.v-list-item__content,
.v-list-item *,
.v-card__title,
.v-card__subtitle,
.v-card__text,
.v-card *,
.v-chip__content,
.v-chip *,
.v-snack__content,
.v-dialog,
.v-dialog *,
.v-menu__content,
.v-menu__content *,
.v-alert__content,
.v-alert *,
.v-label,
.v-messages__message,
p, span, div, h1, h2, h3, h4, h5, h6,
.subtitle-1, .subtitle-2,
.text-h1, .text-h2, .text-h3, .text-h4, .text-h5, .text-h6 {
    font-family: 'MainFont', Arial, sans-serif !important;
}

input, textarea, select, button, label {
    font-family: 'MainFont', Arial, sans-serif !important;
}

.mdi:before,
.mdi-set {
    font-family: 'Material Design Icons' !important;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

#app {
    height: 100%;
}

.application {
    background-color: #f5f5f5 !important;
}

.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-header .v-list-item__content {
    padding-left: 0;
}

.chat-header .v-list-item-avatar {
    margin-left: 16px;
    margin-right: 12px;
}

.chat-header .v-list-item__title {
    margin-right: 10px;
    margin-bottom: 2px;
}

.chat-header .v-list-item__subtitle {
    margin-right: 10px;
    font-size: 0.75rem;
    margin-top: 2px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 70px 16px 120px 16px;
    background: #f5f5f5;
}



.message-item {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    transition: transform 0.2s ease-out;
}

.message-item.received {
    justify-content: flex-end;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid white;
}

.message-avatar {
    width: 32px;
    height: 32px;
    margin: 0 8px;
}

.message-item:not(.received) .message-avatar {
    order: 0;
}

.message-item.received .message-avatar {
    order: 2;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    order: 1;
}

.message-item:not(.received) .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-item.received .message-bubble {
    background: #1976D2;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-status {
    display: flex;
    align-items: center;
}

.message-item:not(.received) .message-info {
    justify-content: flex-start;
}

.message-item.received .message-info {
    justify-content: flex-end;
}

.message-item:not(.received) .message-time {
    text-align: left;
    color: rgba(0,0,0,0.6);
}

.message-item.received .message-time {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.reply-preview {
    background: rgba(0,0,0,0.1);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 3px solid #1976D2;
    font-size: 0.875rem;
}

.message-item:not(.received) .reply-preview {
    border-left: none;
    border-right: 3px solid #1976D2;
    background: rgba(0,0,0,0.1);
}

.message-item.received .reply-preview {
    border-right: none;
    border-left: 3px solid white;
    background: rgba(255,255,255,0.2);
}

.conversation-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f5f5f5;
}

.unread-badge {
    background: #4CAF50;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #666;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    margin: 8px 16px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.typing-dots {
    display: inline-flex;
    margin-right: 8px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.message-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 4px 0;
    z-index: 1000;
    min-width: 150px;
}

.message-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.message-menu-item:hover {
    background-color: #f5f5f5;
}

.message-menu-item i {
    margin-left: 12px;
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.1);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #1976D2;
    transition: width 0.3s;
}

.media-message {
    max-width: 250px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.media-message img,
.media-message video {
    width: 100%;
    height: auto;
    display: block;
}

.swipe-action {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #1976D2;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.swipe-action.visible {
    opacity: 1;
}

.login-container,
.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    margin: 0 16px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.captcha-code {
    background: #f5f5f5;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 4px;
    user-select: none;
}

.profile-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #1976D2;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-messages {
        padding: 60px 8px 140px 8px;
    }
}