.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    display: flex; /* Butonu tekrar görünür yap */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(126, 34, 206, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-effect 2s infinite;
    position: relative;
}

/* Bilgisayar sürümünde daha dikkat çekici olması için */
.chat-widget-button::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid #1a1c24;
    animation: blink 1.5s infinite;
}

/* Dikkat çekmek için animasyon */
.chat-widget-button.attention {
    animation: attention-effect 1s ease-in-out;
    transform: scale(1.2);
}

@keyframes attention-effect {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.2); }
}

@keyframes blink {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Masaüstünde widget butonunu gizle, sadece mobildeki navigasyondan erişilecek */
@media (min-width: 1024px) {
    .chat-widget-button {
        display: none;
    }
}

/* Mobilde widget butonunu gizle, navigation'dan erişim sağlanacak - artık gerekli değil */
@media (max-width: 1023px) {
    .chat-widget-button {
        display: none;
    }
    
    /* Açık chat'in alt navigasyon barı ile çakışmaması için */
    .chat-widget-popup {
        padding-bottom: 60px; /* Mobil navigasyon yüksekliği */
    }
    
    .chat-widget-popup .chat-widget-body {
        height: calc(100% - 70px - 60px);
    }
}

@keyframes pulse-effect {
    0% {
        box-shadow: 0 0 0 0 rgba(126, 34, 206, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(126, 34, 206, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(126, 34, 206, 0);
    }
}

.chat-widget-button:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 25px rgba(126, 34, 206, 0.4);
}

.chat-widget-button i {
    font-size: 26px;
}

/* Tam ekran chat widget */
.chat-widget-popup {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1c24;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

/* Mobil cihazlar için iyileştirilmiş tam ekran */
@media (min-width: 768px) {
    .chat-widget-popup {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 1200px;
        height: 90%;
        max-height: 800px;
        border-radius: 24px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (min-width: 1200px) {
    .chat-widget-popup {
        width: 80%;
        height: 80%;
    }
}

.chat-widget-popup.active {
    display: flex;
    opacity: 1;
}

.chat-widget-header {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    padding: 18px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.chat-widget-title i {
    font-size: 20px;
}

.chat-widget-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget-help, 
.chat-widget-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-widget-help:hover, 
.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.chat-widget-close:hover {
    transform: rotate(90deg);
}

.chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100% - 70px);
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #1e1e2d;
    scrollbar-width: thin;
    scrollbar-color: #424255 #1e1e2d;
}

.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-track {
    background: #1e1e2d;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background-color: #424255;
    border-radius: 10px;
}

.chat-message {
    margin-bottom: 16px;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeInMessage 0.3s ease forwards;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    margin-left: auto;
    align-items: flex-end;
}

.bot-message {
    margin-right: auto;
    align-items: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    position: relative;
    overflow: hidden;
}

/* Medya sorguları için mesaj genişliği */
@media (min-width: 768px) {
    .chat-message {
        max-width: 70%;
    }
}

@media (min-width: 1200px) {
    .chat-message {
        max-width: 60%;
    }
}

.user-message .message-content {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 18px 18px 0 18px;
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.15);
}

.bot-message .message-content {
    background: #2e2e40;
    border-radius: 18px 18px 18px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 50%, #4f46e5 50%);
    border-bottom-right-radius: 10px;
}

.bot-message::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(225deg, transparent 50%, #2e2e40 50%);
    border-bottom-left-radius: 10px;
}

.chat-widget-input {
    display: flex;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #1a1c24;
}

.chat-widget-input input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    border-radius: 16px;
    outline: none;
    background-color: #2e2e40;
    color: #e2e8f0;
    font-size: 14px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.chat-widget-input input::placeholder {
    color: #94a3b8;
}

.chat-widget-input input:focus {
    background-color: #343450;
    box-shadow: 0 0 0 2px rgba(126, 34, 206, 0.3);
}

.chat-widget-input button {
    margin-left: 10px;
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(126, 34, 206, 0.2);
}

.chat-widget-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 34, 206, 0.3);
}

.chat-widget-input button i {
    font-size: 18px;
}

.chat-button {
    display: inline-block;
    margin: 5px 5px 5px 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 3px 8px rgba(126, 34, 206, 0.2);
}

.chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(126, 34, 206, 0.3);
}

/* Yardım paneli stilleri */
.chat-help-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: #1a1c24;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001; /* Diğer elementlerin üstünde olması için z-index artırıldı */
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
}

.chat-help-panel.active {
    right: 0;
}

.chat-help-header {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-help-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-help-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-help-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.chat-help-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #424255 #1e1e2d;
}

.chat-help-section {
    margin-bottom: 24px;
    background: #2e2e40;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-help-section h3 {
    color: #e2e8f0;
    font-size: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.chat-help-section p {
    color: #94a3b8;
    margin-bottom: 12px;
    font-size: 14px;
}

.chat-help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-help-section ul li {
    color: #94a3b8;
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
    font-size: 14px;
}

.chat-help-section ul li::before {
    content: '•';
    color: #a855f7;
    position: absolute;
    left: 0;
}

.chat-help-section code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: monospace;
}

.chat-help-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-help-button {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.chat-help-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Metin biçimlendirmesi için stiller */
.message-content strong {
    font-weight: 700;
    color: #f9fafb;
}

.message-content em {
    font-style: italic;
    color: #f9fafb;
}

.message-content u {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

.message-content s {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.7);
}

.message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    color: #e2e8f0;
}

/* Ürün görselleri için stil */
.chat-product-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: block;
    width: 200px;
    background-color: #2a2a3a;
}

.bot-message .chat-product-image {
    margin-left: 0;
    margin-right: auto;
}

.user-message .chat-product-image {
    margin-left: auto;
    margin-right: 0;
}

/* Yeni ürün kartı tasarımı */
.chat-product-card {
    display: flex;
    background: #2a2a3a;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.chat-product-image-container {
    width: 100px;
    min-width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222230;
    padding: 8px;
}

.chat-product-image-container .chat-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 6px;
}

.chat-product-details {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-product-name {
    color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.chat-product-price {
    color: #a855f7;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}

.chat-product-buttons {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.chat-product-buttons .chat-button {
    flex: 1;
    text-align: center;
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
}

/* Sepet öğeleri için stiller */
.chat-cart-item {
    display: flex;
    background: #2a2a3a;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-cart-image, .cart-item-image {
    width: 70px;
    min-width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222230;
}

.chat-cart-image img, .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
    border: none;
    box-shadow: none;
}

.chat-cart-details, .cart-item-details {
    padding: 8px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-cart-name, .cart-item-name {
    color: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.chat-cart-price, .cart-item-price {
    color: #a855f7;
    font-weight: 700;
    font-size: 14px;
    margin-top: 3px;
}

.chat-cart-quantity, .cart-item-quantity {
    color: #94a3b8;
    font-size: 12px;
    margin-top: auto;
}

.chat-cart-total {
    text-align: right;
    color: #e2e8f0;
    font-size: 15px;
    margin: 10px 0;
}

.chat-cart-total strong {
    color: #a855f7;
    font-size: 17px;
}

.chat-cart-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chat-cart-buttons .chat-button {
    flex: 1;
    text-align: center;
}

/* Yeni sepet görünümü */
.chat-cart-container {
    background: #232333;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

.chat-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.chat-cart-header h3 {
    margin: 0;
    color: #f9fafb;
    font-size: 18px;
    font-weight: 600;
}

.cart-item-count {
    color: #94a3b8;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 10px;
}

.chat-cart-items {
    margin-bottom: 15px;
}

.chat-cart-empty {
    text-align: center;
    padding: 30px 20px;
    background: #2a2a3a;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #a855f7;
}

.chat-cart-empty p {
    color: #94a3b8;
    margin: 8px 0;
}

.empty-buttons {
    margin-top: 20px;
}

.original-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 12px;
    margin-left: 5px;
}

.discount-price {
    color: #a855f7;
}

.discount-badge {
    background: #a855f7;
    color: white;
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 11px;
    margin-left: 5px;
}

.chat-cart-summary {
    background: #2a2a3a;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-size: 14px;
}

.summary-row.discount {
    color: #ef4444;
}

.summary-row.total {
    font-weight: 700;
    font-size: 16px;
    color: #f9fafb;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 5px;
}

.summary-row.total span:last-child {
    color: #a855f7;
    font-size: 18px;
}

.primary-button {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
}

.secondary-button {
    background: rgba(126, 34, 206, 0.3);
}

.secondary-button:hover {
    background: rgba(126, 34, 206, 0.4);
}

/* Animasyon ve özel efektler */
@keyframes typing {
    0% { width: 0 }
    100% { width: 100% }
}

.typing-indicator {
    display: inline-block;
    position: relative;
    width: 50px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 2px;
    background-color: #a855f7;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: 1s blink infinite 0.3333s;
}

.typing-indicator span:nth-of-type(2) {
    animation: 1s blink infinite 0.6666s;
}

.typing-indicator span:nth-of-type(3) {
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

/* Görünür/gizli animasyonları */
.show-widget {
    display: flex !important;
    animation: showWidget 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hide-widget {
    animation: hideWidget 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes showWidget {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes hideWidget {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Body overflow kontrolü */
body.chat-open {
    overflow: hidden;
}

/* Mobil cihazlar için yardım paneli düzenlemesi */
@media (max-width: 767px) {
    .chat-help-panel {
        width: 100%;
        right: -100%;
    }
    
    .chat-help-panel.active {
        right: 0;
    }
}

/* Yardım paneli açıkken sayfa arkaplanını hafifçe karart */
body.help-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    pointer-events: none;
}

/* Soru işareti butonu belirginleştirme */
.chat-widget-help {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.chat-widget-help:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Soru işareti butonu için animasyon */
.chat-widget-help::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Responsive iyileştirmeler */
@media (max-width: 480px) {
    .chat-widget-popup {
        padding-bottom: 70px; /* Mobil menü yüksekliği için daha fazla boşluk */
    }
    
    .chat-widget-messages {
        padding: 15px 12px; /* Daha kompakt mesaj alanı */
    }
    
    .chat-message {
        max-width: 95%; /* Daha geniş mesaj balonu */
    }
    
    .message-content {
        padding: 10px 12px; /* Daha kompakt mesaj içeriği */
        font-size: 13px; /* Daha küçük yazı */
    }
    
    .chat-widget-input {
        padding: 10px;
    }
    
    .chat-widget-input input {
        padding: 10px 12px;
    }
    
    .chat-widget-input button {
        width: 38px;
        height: 38px;
    }
    
    .chat-product-card {
        flex-direction: column; /* Ürün kartlarını dikey hizalama */
    }
    
    .chat-product-image-container {
        width: 100%;
        height: 120px;
    }
    
    .chat-product-buttons {
        flex-direction: column;
        gap: 5px;
    }
}

/* iPad/tablet cihazlar için düzenlemeler */
@media (min-width: 481px) and (max-width: 768px) {
    .chat-widget-popup {
        width: 95%;
        height: 95%;
    }
    
    .chat-message {
        max-width: 80%;
    }
}

/* Dokunmatik cihazlar için dokunma alanlarını iyileştirme */
@media (pointer: coarse) {
    .chat-button, 
    .chat-help-button, 
    .chat-widget-input button,
    .chat-widget-help,
    .chat-widget-close,
    .chat-help-close,
    .add-to-cart-btn, 
    .buy-now-btn {
        min-height: 44px; /* Dokunmatik için ideal minimum yükseklik */
        min-width: 44px;
        padding: 10px 16px;
    }
    
    .chat-help-buttons {
        gap: 12px; /* Butonlar arası daha fazla boşluk */
    }
    
    .chat-widget-help,
    .chat-widget-close {
        width: 40px;
        height: 40px;
    }
}

/* Mesaj baloncuklarının responsive görünümünü iyileştirme */
.bot-message .message-content {
    border-radius: 18px 18px 18px 0;
}

.user-message .message-content {
    border-radius: 18px 18px 0 18px;
}

/* Dark mode desteği */
@media (prefers-color-scheme: dark) {
    .chat-widget-popup {
        background-color: #0f1117;
    }
    
    .chat-help-panel {
        background-color: #0f1117;
    }
    
    .bot-message .message-content {
        background: #252836;
    }
    
    .chat-widget-header,
    .chat-help-header {
        background: linear-gradient(135deg, #7c3aed, #6025c0);
    }
} 