/* === SOHBET SAYFASI CSS === */

/* Ana Container - WhatsApp Tarzında */
.chat-container {
    display: flex;
    height: 100vh;
    background: #f0f0f0;
}



/* Ana Sohbet Alanı - WhatsApp Tarzında */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    height: 100vh;
}

/* Sohbet Header - WhatsApp Tarzında */
.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #075e54; /* WhatsApp koyu yeşil */
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header-left {
    display: flex;
    align-items: center;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.chat-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.chat-control-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Mesaj Alanı - WhatsApp Tarzında */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #e5ddd5; /* WhatsApp arka plan rengi */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    position: relative;
    height: calc(100vh - 110px); /* Header (~70px) + Input (~40px) için alan bırak */
    margin-top: 0; /* Üst margin'i kaldır */
    z-index: 1;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.car-logo-mini {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message-content {
    max-width: 65%;
    background: white;
    padding: 8px 12px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    word-wrap: break-word;
    min-width: 0;
    overflow: visible;
}

.message.own .message-content {
    background: #dcf8c6; /* WhatsApp yeşil rengi */
    color: #000;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    min-width: 0;
}

.message-username {
    font-weight: 600;
    color: #075e54;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.message.own .message-username {
    color: #128c7e;
}

.message-time {
    font-size: 11px;
    color: #999;
    font-weight: normal;
    white-space: nowrap;
    flex-shrink: 0;
}

.message.own .message-time {
    color: #128c7e;
}

.message-text {
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    color: #000;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message.own .message-text {
    color: #000;
}

/* Görsel Mesaj */
.message-image {
    max-width: 180px;
    max-height: 140px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin: 4px 0;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}



/* Admin Mesaj Stilleri */
.message.admin-message .message-username {
    color: #d63031;
    font-weight: bold;
}

.message.admin-message .admin-icon {
    border: 2px solid #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* Admin mesajı silindiğinde */
.message.admin-message.deleted {
    /* Silinen admin mesajları için özel stil yok */
}

/* Silinen Mesaj Stilleri */
.message.deleted .message-content {
    opacity: 0.6;
    background: #f8f9fa !important;
    border: 1px dashed #dee2e6;
}

.message.deleted .message-text {
    font-style: italic;
    color: #6c757d;
}

.message.deleted .message-username {
    color: #6c757d !important;
}

.message.deleted .message-time {
    color: #adb5bd !important;
}



/* Mesaj Gönderme Alanı - WhatsApp Tarzında */
.message-input-container {
    padding: 6px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f0f0f0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.message-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: white;
    border-radius: 25px;
    padding: 1px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-input {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 6px 0;
    font-size: 14px;
    resize: none;
    max-height: 80px;
    transition: all 0.3s ease;
    background: transparent;
}

.message-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.input-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.input-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.send-btn {
    background: #25d366 !important; /* WhatsApp yeşil rengi */
    color: white !important;
    width: 32px;
    height: 32px;
}

.send-btn:hover {
    background: #128c7e !important;
    transform: scale(1.05);
}

/* Yazma Durumu - WhatsApp Tarzında */
.typing-indicator {
    padding: 8px 20px;
    color: #666;
    font-style: italic;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    margin: 0 20px;
    display: inline-block;
}

/* Sabitlenen Mesajlar - Ultra Kompakt */
.pinned-messages {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0;
    padding: 6px 10px;
    margin: 0 0 0 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pinned-message-display {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 40px;
}

.pinned-message-item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 4px 8px;
    border-left: 2px solid #f39c12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.5s ease;
    cursor: pointer;
}

.pinned-message-item.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}

.pinned-message-item.slide-right {
    transform: translateX(100%);
    opacity: 0;
}

.pinned-message-item.active {
    transform: translateX(0);
    opacity: 1;
}

.pinned-message-content {
    color: #856404;
    font-size: 12px;
    line-height: 1.3;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigasyon kontrolleri kaldırıldı - sadece otomatik dönüşüm */

/* Görsel Önizleme Modal */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 95%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.image-preview-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.image-preview-body {
    padding: 20px;
}

.image-preview-body img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview-body textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.image-preview-body textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.image-preview-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    justify-content: flex-end;
}

.cancel-btn, .send-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
}

.send-btn {
    background: #28a745;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.send-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

/* Eski stiller kaldırıldı - yeni dönüşümlü sistem kullanılıyor */

/* Görsel Mesaj Stilleri */
.message-image {
    display: block;
    transition: transform 0.2s ease;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Görsel mesaj balonları için taşma kontrolü */
.message .message-text {
    overflow: hidden;
    word-wrap: break-word;
}

.message .message-text img {
    max-width: 100% !important;
    height: auto !important;
}

.message-caption {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    border-left: 3px solid #ddd;
}

/* Görsel mesaj balonları için özel stil */
.message .message-text:has(img) {
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

/* Görsel yükleme göstergesi */
.image-upload-info {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #0056b3;
}

.image-upload-info .info-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.image-upload-info .compression-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

/* Mesaj balonları için genel taşma kontrolü */
.message {
    max-width: 100%;
    overflow: hidden;
}

.message-content {
    max-width: 100%;
    overflow: hidden;
}

.message-text {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

.pinned-message-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(231, 76, 60, 0.1);
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    transition: all 0.2s ease;
}

.pinned-message-remove:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

/* Mention Sistemi - WhatsApp Tarzında */
.mention {
    background: #e8f5e8;
    color: #128c7e;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9em;
}



/* Responsive - WhatsApp Tarzında */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .chat-main {
        flex: 1;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .message-image {
        max-width: 120px;
        max-height: 100px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
    }
}

/* Scrollbar Stilleri - WhatsApp Tarzında */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Animasyonlar - WhatsApp Tarzında */
.message {
    animation: messageSlideIn 0.2s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Uzun Basma Menüsü - WhatsApp Tarzında */
.message-context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 10000;
    min-width: 160px;
    opacity: 0;
    transform: scale(0.8);
    transform-origin: top left;
    transition: all 0.2s ease;
    overflow: hidden;
}

.message-context-menu.show {
    opacity: 1;
    transform: scale(1);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-item i {
    font-size: 16px;
    color: #666;
    width: 20px;
    text-align: center;
}

.menu-item span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Mobil için özel stiller */
@media (max-width: 768px) {
    .message-context-menu {
        min-width: 140px;
        border-radius: 10px;
    }
    
    .menu-item {
        padding: 14px 16px;
    }
    
    .menu-item i {
        font-size: 18px;
    }
    
    .menu-item span {
        font-size: 15px;
    }
}

/* Touch cihazlar için hover efektini kapat */
@media (hover: none) {
    .menu-item:hover {
        background-color: transparent;
    }
}


