/* Widget Ana Konteynerı */
.chatx-container {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    opacity: 0;
    transform: translateY(20px);
    animation: chatx-fadeInUp 0.5s ease-out forwards;
}

@keyframes chatx-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatx-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pozisyon Ayarları */
.chatx-position-right {
    right: 20px;
}

.chatx-position-left {
    left: 20px;
}

.chatx-position-left .chatx-menu {
    left: 0;
    right: auto;
}

/* İkon Stil Ayarları */
.chatx-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #008080 0%, #00a0a0 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.chatx-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 128, 128, 0.4);
    background: linear-gradient(135deg, #00a0a0 0%, #008080 100%);
}

.chatx-icon:active {
    transform: scale(1.05);
}

.chatx-icon.active {
    transform: scale(1.1) rotate(180deg);
    background: linear-gradient(135deg, #006666 0%, #008080 100%);
}

.chatx-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.chatx-icon:hover svg {
    transform: scale(1.1);
}

/* Pulse animasyonu */
.chatx-icon::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #008080 0%, #00a0a0 100%);
    animation: chatx-pulse 2s infinite;
    z-index: -1;
    opacity: 0;
}

@keyframes chatx-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Açılır Menü Stil Ayarları */
.chatx-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    bottom: 75px;
    right: 0;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chatx-menu.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chatx-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 128, 128, 0.3), transparent);
}

.chatx-menu li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s ease;
}

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

.chatx-menu li:hover {
    background-color: rgba(0, 128, 128, 0.05);
}

.chatx-link {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    line-height: 1.4;
}

.chatx-link:hover {
    color: #008080;
    transform: translateX(5px);
    text-decoration: none;
}

.chatx-link:focus {
    outline: 2px solid #008080;
    outline-offset: -2px;
}

.chatx-icon-small {
    font-size: 18px;
    margin-right: 12px;
    min-width: 24px;
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.chatx-link:hover .chatx-icon-small {
    opacity: 1;
}

.chatx-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chatx-text small {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    margin-top: 2px;
}

/* WhatsApp, Telefon ve Instagram için özel renkler */
.chatx-whatsapp:hover {
    color: #25D366;
}

.chatx-whatsapp:hover .chatx-icon-small {
    color: #25D366;
}

.chatx-phone:hover {
    color: #0066CC;
}

.chatx-phone:hover .chatx-icon-small {
    color: #0066CC;
}

.chatx-instagram:hover {
    color: #E4405F;
}

.chatx-instagram:hover .chatx-icon-small {
    color: #E4405F;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .chatx-container {
        bottom: 15px;
    }
    
    .chatx-position-right {
        right: 15px;
    }
    
    .chatx-position-left {
        left: 15px;
    }
    
    .chatx-icon {
        width: 55px;
        height: 55px;
    }
    
    .chatx-menu {
        min-width: 260px;
        bottom: 70px;
    }
    
    .chatx-link {
        padding: 14px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .chatx-menu {
        min-width: 240px;
        right: -20px;
    }
    
    .chatx-position-left .chatx-menu {
        left: -20px;
        right: auto;
    }
    
    .chatx-link {
        padding: 12px 14px;
    }
}

/* Dark mode desteği */
@media (prefers-color-scheme: dark) {
    .chatx-menu {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .chatx-link {
        color: #f0f0f0;
    }
    
    .chatx-menu li {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .chatx-menu li:hover {
        background-color: rgba(0, 128, 128, 0.15);
    }
}

/* High contrast mode desteği */
@media (prefers-contrast: high) {
    .chatx-icon {
        border: 2px solid #000;
    }
    
    .chatx-menu {
        border: 2px solid #000;
        background: #fff;
    }
    
    .chatx-link {
        color: #000;
    }
}

/* Reduced motion desteği */
@media (prefers-reduced-motion: reduce) {
    .chatx-container,
    .chatx-icon,
    .chatx-menu,
    .chatx-link,
    .chatx-icon-small {
        animation: none;
        transition: none;
    }
    
    .chatx-icon::before {
        animation: none;
    }
}

/* Print medya için gizle */
@media print {
    .chatx-container {
        display: none !important;
    }
}

/* Accessibility iyileştirmeleri */
.chatx-icon[role="button"] {
    cursor: pointer;
}

.chatx-icon:focus-visible {
    outline: 2px solid #008080;
    outline-offset: 2px;
}

/* Loading state */
.chatx-container.loading .chatx-icon {
    animation: chatx-spin 1s linear infinite;
}

@keyframes chatx-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}