/**
 * TrendKaucuk WhatsApp Button - Frontend Styles
 *
 * @package TrendKaucuk_WhatsApp
 * @author TeknowWeb Teknoloji
 * @link https://teknoweb.net
 */

/* CSS Degiskenleri (fallback'ler) */
:root {
    --tkw-color: #25D366;
    --tkw-z-index: 9999;
    --tkw-bottom: 20px;
    --tkw-side: 20px;
}

/* Ana Container */
.tkw-whatsapp-container {
    position: fixed;
    bottom: var(--tkw-bottom, 20px);
    z-index: var(--tkw-z-index, 9999);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Konum - Sol */
.tkw-whatsapp-container.tkw-position-left {
    left: var(--tkw-side, 20px);
    right: auto;
}

/* Konum - Sag */
.tkw-whatsapp-container.tkw-position-right {
    right: var(--tkw-side, 20px);
    left: auto;
}

/* Ana Buton */
.tkw-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--tkw-color, #25D366);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4),
                0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none !important;
    border: none;
    outline: none;
}

.tkw-button:hover,
.tkw-button:focus {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5),
                0 4px 15px rgba(0, 0, 0, 0.15);
}

.tkw-button:active {
    transform: scale(1.05);
}

/* WhatsApp Icon */
.tkw-icon {
    width: 32px;
    height: 32px;
    color: #fff;
    fill: currentColor;
}

/* Boyutlar */
/* Kucuk */
.tkw-size-small .tkw-button {
    width: 50px;
    height: 50px;
}

.tkw-size-small .tkw-icon {
    width: 26px;
    height: 26px;
}

/* Orta (varsayilan) */
.tkw-size-medium .tkw-button {
    width: 60px;
    height: 60px;
}

.tkw-size-medium .tkw-icon {
    width: 32px;
    height: 32px;
}

/* Buyuk */
.tkw-size-large .tkw-button {
    width: 70px;
    height: 70px;
}

.tkw-size-large .tkw-icon {
    width: 38px;
    height: 38px;
}

/* Nabiz Animasyonu */
.tkw-pulse .tkw-button {
    animation: tkw-pulse 2s infinite;
}

@keyframes tkw-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7),
                    0 4px 20px rgba(37, 211, 102, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(37, 211, 102, 0),
                    0 4px 20px rgba(37, 211, 102, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0),
                    0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

.tkw-pulse .tkw-button:hover {
    animation: none;
}

/* Tooltip */
.tkw-tooltip {
    position: absolute;
    bottom: 100%;
    margin-bottom: 10px;
    padding: 8px 14px;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.tkw-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #333;
}

/* Tooltip - Sol konum */
.tkw-position-left .tkw-tooltip {
    left: 0;
}

.tkw-position-left .tkw-tooltip::after {
    left: 20px;
}

/* Tooltip - Sag konum */
.tkw-position-right .tkw-tooltip {
    right: 0;
}

.tkw-position-right .tkw-tooltip::after {
    right: 20px;
}

/* Tooltip Hover */
.tkw-whatsapp-container:hover .tkw-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mesaj Baloncugu */
.tkw-bubble {
    position: absolute;
    bottom: calc(100% + 15px);
    background: #fff;
    padding: 12px 40px 12px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(10px);
    transform-origin: bottom left;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tkw-bubble.tkw-bubble-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.tkw-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    border: 8px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Baloncuk - Sol konum */
.tkw-position-left .tkw-bubble {
    left: 0;
    transform-origin: bottom left;
}

.tkw-position-left .tkw-bubble::after {
    left: 22px;
}

/* Baloncuk - Sag konum */
.tkw-position-right .tkw-bubble {
    right: 0;
    transform-origin: bottom right;
}

.tkw-position-right .tkw-bubble::after {
    right: 22px;
}

/* Baloncuk Kapat Butonu */
.tkw-bubble-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.tkw-bubble-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Cihaz Gizleme */
/* Mobil gizle (max 767px) */
@media (max-width: 767px) {
    .tkw-hide-mobile {
        display: none !important;
    }
}

/* Tablet gizle (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .tkw-hide-tablet {
        display: none !important;
    }
}

/* Desktop gizle (min 1025px) */
@media (min-width: 1025px) {
    .tkw-hide-desktop {
        display: none !important;
    }
}

/* Responsive Ayarlar */
/* Mobil */
@media (max-width: 767px) {
    .tkw-whatsapp-container {
        --tkw-bottom: 15px;
        --tkw-side: 15px;
    }

    .tkw-size-small .tkw-button {
        width: 45px;
        height: 45px;
    }

    .tkw-size-small .tkw-icon {
        width: 24px;
        height: 24px;
    }

    .tkw-size-medium .tkw-button {
        width: 52px;
        height: 52px;
    }

    .tkw-size-medium .tkw-icon {
        width: 28px;
        height: 28px;
    }

    .tkw-size-large .tkw-button {
        width: 60px;
        height: 60px;
    }

    .tkw-size-large .tkw-icon {
        width: 32px;
        height: 32px;
    }

    /* Mobilde tooltip gizle */
    .tkw-tooltip {
        display: none;
    }

    /* Mobilde baloncuk */
    .tkw-bubble {
        font-size: 13px;
        padding: 10px 35px 10px 14px;
        max-width: calc(100vw - 100px);
        white-space: normal;
    }

    .tkw-bubble-close {
        width: 18px;
        height: 18px;
        font-size: 14px;
        right: 10px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .tkw-whatsapp-container {
        --tkw-bottom: 20px;
        --tkw-side: 20px;
    }

    .tkw-size-small .tkw-button {
        width: 48px;
        height: 48px;
    }

    .tkw-size-medium .tkw-button {
        width: 56px;
        height: 56px;
    }

    .tkw-size-large .tkw-button {
        width: 64px;
        height: 64px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .tkw-whatsapp-container {
        --tkw-bottom: 25px;
        --tkw-side: 25px;
    }
}

/* Offline Durumu */
.tkw-whatsapp-container.tkw-offline .tkw-button {
    background-color: #999;
    cursor: not-allowed;
}

.tkw-whatsapp-container.tkw-offline .tkw-button:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(150, 150, 150, 0.4);
}

.tkw-whatsapp-container.tkw-offline .tkw-tooltip {
    background: #666;
}

.tkw-whatsapp-container.tkw-offline .tkw-tooltip::after {
    border-top-color: #666;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    .tkw-button,
    .tkw-tooltip,
    .tkw-bubble,
    .tkw-bubble-close {
        transition: none;
    }

    .tkw-pulse .tkw-button {
        animation: none;
    }
}

/* Print - Gizle */
@media print {
    .tkw-whatsapp-container {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tkw-button {
        border: 2px solid #fff;
    }

    .tkw-bubble {
        border: 2px solid #333;
    }
}

/* Focus Visible (Accessibility) */
.tkw-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(37, 211, 102, 0.5);
}

.tkw-bubble-close:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}
