/*
 * WhatsApp İletişim Pro - CSS Dosyası (Güncellenmiş)
 * Geliştirici: Ali Karabüyük
 * Web: www.alikarabuyuk.com
 * Tel: +905556504111
 * Mail: info@alikarabuyuk.com
 * Versiyon: 1.0.1 (Gecikme ve mobil link sorunu düzeltildi)
 */

/* Ana container */
#whatsapp-pro-container {
    position: relative;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Başlangıçta tamamen gizli - GECİKME SORUNU DÜZELTİLDİ */
    opacity: 0;
    visibility: hidden;
    display: none;
}

/* Gizli durumda başlat - GÜÇLENDİRİLDİ */
#whatsapp-pro-container.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Görünür duruma geçiş - GÜÇLENDİRİLDİ */
#whatsapp-pro-container.visible {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Tam genişlik butonlar için body padding ayarı */
body.whatsapp-pro-top-space {
    padding-top: 60px !important;
}

body.whatsapp-pro-bottom-space {
    padding-bottom: 60px !important;
}

/* Tam genişlik üst buton */
.whatsapp-pro-full-width.whatsapp-pro-full-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    z-index: 99999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDownFadeIn 0.6s ease-out;
}

/* Tam genişlik alt buton */
.whatsapp-pro-full-width.whatsapp-pro-full-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    z-index: 99999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUpFadeIn 0.6s ease-out;
}

/* Tam genişlik buton linkleri */
.whatsapp-pro-full-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 0 20px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.whatsapp-pro-full-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.whatsapp-pro-full-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

/* SVG ikonlar */
.whatsapp-pro-full-link svg,
.whatsapp-pro-corner-link svg {
    margin-right: 12px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Köşe butonları */
.whatsapp-pro-corner {
    position: fixed;
    z-index: 99999;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: bounceIn 0.8s ease-out;
    height: 50px;
    min-width: 50px;
}

/* Köşe buton konumları */
.whatsapp-pro-bottom-right {
    bottom: 30px;
    right: 30px;
}

.whatsapp-pro-bottom-left {
    bottom: 30px;
    left: 30px;
}

.whatsapp-pro-top-right {
    top: 30px;
    right: 30px;
}

.whatsapp-pro-top-left {
    top: 30px;
    left: 30px;
}

/* Köşe buton hover efektleri */
.whatsapp-pro-corner:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.whatsapp-pro-corner:active {
    transform: translateY(-1px) scale(1.02);
}

/* Köşe buton linkleri */
.whatsapp-pro-corner-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 0 15px;
    font-weight: 600;
    font-size: 14px;
    border-radius: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.whatsapp-pro-corner-link:hover,
.whatsapp-pro-corner-link:focus {
    text-decoration: none;
    color: inherit;
}

.whatsapp-pro-corner-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Pulse animasyonu */
.whatsapp-pro-corner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
    z-index: -1;
}

/* Responsive tasarım - Tablet */
@media (max-width: 1024px) {
    .whatsapp-pro-corner {
        bottom: 25px;
        right: 25px;
    }
    
    .whatsapp-pro-bottom-left {
        left: 25px;
    }
    
    .whatsapp-pro-top-right {
        top: 25px;
        right: 25px;
    }
    
    .whatsapp-pro-top-left {
        top: 25px;
        left: 25px;
    }
}

/* Responsive tasarım - Mobil */
@media (max-width: 768px) {
    /* Mobilde köşe butonları */
    .whatsapp-pro-corner {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        border-radius: 30px;
        padding: 0;
    }
    
    .whatsapp-pro-bottom-left {
        left: 20px;
    }
    
    .whatsapp-pro-top-right {
        top: 20px;
        right: 20px;
    }
    
    .whatsapp-pro-top-left {
        top: 20px;
        left: 20px;
    }
    
    /* Mobilde sadece ikon göster */
    .whatsapp-pro-corner-link span {
        display: none;
    }
    
    .whatsapp-pro-corner-link {
        padding: 0;
        justify-content: center;
    }
    
    .whatsapp-pro-corner-link svg {
        margin: 0;
        width: 28px;
        height: 28px;
    }
    
    /* Tam genişlik butonlarda yazı boyutu */
    .whatsapp-pro-full-link {
        font-size: 15px;
        padding: 0 15px;
    }
    
    /* Body padding'i mobilde azalt */
    body.whatsapp-pro-top-space {
        padding-top: 55px !important;
    }
    
    body.whatsapp-pro-bottom-space {
        padding-bottom: 55px !important;
    }
    
    .whatsapp-pro-full-width {
        height: 55px;
    }
}

@media (max-width: 480px) {
    .whatsapp-pro-corner {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-pro-bottom-left {
        left: 15px;
    }
    
    .whatsapp-pro-top-right {
        top: 15px;
        right: 15px;
    }
    
    .whatsapp-pro-top-left {
        top: 15px;
        left: 15px;
    }
    
    .whatsapp-pro-full-link {
        font-size: 14px;
        padding: 0 12px;
    }
    
    .whatsapp-pro-full-link svg {
        width: 20px;
        height: 20px;
        margin-right: 8px;
    }
}

/* Küçük ekranlar için ekstra optimizasyon */
@media (max-width: 360px) {
    .whatsapp-pro-corner {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-pro-bottom-left {
        left: 10px;
    }
    
    .whatsapp-pro-top-right {
        top: 10px;
        right: 10px;
    }
    
    .whatsapp-pro-top-left {
        top: 10px;
        left: 10px;
    }
    
    .whatsapp-pro-corner-link svg {
        width: 24px;
        height: 24px;
    }
    
    .whatsapp-pro-full-link {
        font-size: 13px;
        padding: 0 10px;
    }
    
    .whatsapp-pro-full-link svg {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }
}

/* Animasyonlar */
@keyframes slideDownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(-90deg);
    }
    70% {
        transform: scale(0.9) rotate(-45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    70% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1.4);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.8);
    }
}

/* Hover için mikro animasyonlar */
.whatsapp-pro-full-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.whatsapp-pro-full-link:hover::before {
    left: 100%;
}

/* Click efekti */
.whatsapp-pro-corner-link.clicked,
.whatsapp-pro-full-link.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Loading state */
.whatsapp-pro-loading {
    opacity: 0.7;
    pointer-events: none;
}

.whatsapp-pro-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Debug modu için görsel ipuçları */
[data-device="mobile"] .whatsapp-pro-corner::after {
    content: '📱';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    opacity: 0.7;
    pointer-events: none;
}

[data-device="tablet"] .whatsapp-pro-corner::after {
    content: '📱';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    opacity: 0.7;
    pointer-events: none;
}

[data-device="desktop"] .whatsapp-pro-corner::after {
    content: '💻';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    opacity: 0.7;
    pointer-events: none;
}

/* Debug mode sadece development'ta görünür */
body:not(.debug-mode) [data-device]::after {
    display: none !important;
}

/* Erişilebilirlik */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-pro-corner,
    .whatsapp-pro-full-width,
    .whatsapp-pro-corner-link,
    .whatsapp-pro-full-link {
        animation: none;
        transition: none;
    }
    
    .whatsapp-pro-corner::before {
        animation: none;
    }
    
    .whatsapp-pro-full-link::before {
        transition: none;
    }
}

/* Print medyasında gizle */
@media print {
    #whatsapp-pro-container {
        display: none !important;
    }
}

/* Yüksek kontrast modu */
@media (prefers-contrast: high) {
    .whatsapp-pro-corner,
    .whatsapp-pro-full-width {
        border: 2px solid;
    }
    
    .whatsapp-pro-corner-link,
    .whatsapp-pro-full-link {
        font-weight: 700;
    }
}

/* Dark mode desteği */
@media (prefers-color-scheme: dark) {
    .whatsapp-pro-corner {
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .whatsapp-pro-full-width {
        box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Focus visible modern desteği */
.whatsapp-pro-corner-link:focus-visible,
.whatsapp-pro-full-link:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Safari için özel düzenlemeler */
@supports (-webkit-backdrop-filter: blur(10px)) {
    .whatsapp-pro-corner {
        -webkit-backdrop-filter: blur(10px);
    }
}

/* iOS Safari için özel düzenlemeler */
@supports (-webkit-touch-callout: none) {
    .whatsapp-pro-corner,
    .whatsapp-pro-full-width {
        -webkit-tap-highlight-color: transparent;
    }
    
    .whatsapp-pro-corner-link,
    .whatsapp-pro-full-link {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
}

/* Firefox için özel düzenlemeler */
@-moz-document url-prefix() {
    .whatsapp-pro-corner {
        backdrop-filter: none;
    }
}

/* Edge için özel düzenlemeler */
@supports (-ms-ime-align: auto) {
    .whatsapp-pro-corner {
        backdrop-filter: none;
    }
}

/* Landscape mode mobil düzenlemeleri */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .whatsapp-pro-corner {
        bottom: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-pro-bottom-left {
        left: 10px;
    }
    
    .whatsapp-pro-top-right {
        top: 10px;
        right: 10px;
    }
    
    .whatsapp-pro-top-left {
        top: 10px;
        left: 10px;
    }
    
    body.whatsapp-pro-top-space {
        padding-top: 45px !important;
    }
    
    body.whatsapp-pro-bottom-space {
        padding-bottom: 45px !important;
    }
    
    .whatsapp-pro-full-width {
        height: 45px;
    }
}

/* RTL (Right-to-Left) dil desteği */
[dir="rtl"] .whatsapp-pro-full-link svg,
[dir="rtl"] .whatsapp-pro-corner-link svg {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .whatsapp-pro-bottom-right {
    right: auto;
    left: 30px;
}

[dir="rtl"] .whatsapp-pro-bottom-left {
    left: auto;
    right: 30px;
}

[dir="rtl"] .whatsapp-pro-top-right {
    right: auto;
    left: 30px;
}

[dir="rtl"] .whatsapp-pro-top-left {
    left: auto;
    right: 30px;
}

/* Tema uyumluluğu için genel düzenlemeler */
.whatsapp-pro-corner-link *,
.whatsapp-pro-full-link * {
    box-sizing: border-box;
}

/* Sticky navigation ile uyumluluk */
body.admin-bar.whatsapp-pro-top-space {
    padding-top: calc(60px + 32px) !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar.whatsapp-pro-top-space {
        padding-top: calc(60px + 46px) !important;
    }
}

/* Son optimizasyonlar */
.whatsapp-pro-corner,
.whatsapp-pro-full-width {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU acceleration */
.whatsapp-pro-corner-link,
.whatsapp-pro-full-link {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* GECİKME SORUNU DÜZELTİLDİ - Bu kurallar çok önemli! */
#whatsapp-pro-container[data-delay] {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

#whatsapp-pro-container[data-delay].visible {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}