/* Floating Chat Icon Wrapper */
.cw-chat-icon-wrapper {
    position: fixed;
    bottom: 40px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cw-chat-icon-wrapper.cw-visible {
    opacity: 1;
    pointer-events: all;
}

/* Floating Chat Icon */
.cw-chat-icon {
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    overflow: hidden;
    flex-shrink: 0;
}

.cw-chat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.cw-chat-icon.cw-scrolled {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
    animation: cw-fade-in 0.5s ease forwards;
}

.cw-chat-icon:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(220, 20, 60, 0.6);
}

.cw-chat-icon.cw-hidden {
    opacity: 0 !important;
    transform: scale(0.8) !important;
    pointer-events: none !important;
}

/* Chat Tooltip */
.cw-chat-tooltip {
    position: relative;
    background: #fff;
    color: #000;
    padding: 10px 15px;
    padding-top: 25px;
    padding-right: 30px;
    border-radius: 8px;
    font-size: 14px;
    white-space: normal;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 200px;
    min-width: 150px;
    cursor: pointer;
    display: block;
    order: -1; /* Icon'un üstünde görünmesi için */
    text-align: left;
}

.cw-tooltip-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: #000;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 10;
}

.cw-tooltip-close:hover {
    opacity: 1;
    border-color: rgba(0, 0, 0, 0.8);
}

.cw-chat-tooltip.cw-tooltip-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.cw-tooltip-text {
    display: block;
    line-height: 1.4;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cw-tooltip-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.cw-chat-icon-wrapper.cw-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.cw-chat-icon-wrapper.cw-hidden .cw-chat-tooltip {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
}

@keyframes cw-fade-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cw-chat-icon svg {
    width: 100%;
    height: 100%;
}

/* Chat Widget Form */
#cw-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #F5F5F5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: Arial, sans-serif;
    font-size: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

#cw-chat-widget.cw-widget-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

#cw-chat-widget.cw-widget-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.cw-widget-header {
    background-color: #8B0000;
    color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.cw-widget-icon {
    width: 40px;
    height: 40px;
    background: #4A90E2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-widget-icon svg {
    width: 24px;
    height: 24px;
}

.cw-widget-title {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
}

.cw-widget-toggle {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.cw-widget-container.cw-collapsed .cw-widget-toggle {
    transform: rotate(180deg);
}

.cw-widget-content {
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
}

.cw-widget-container.cw-collapsed .cw-widget-content {
    display: none;
}

/* Form açıkken icon gizli - JavaScript ile yönetiliyor */

.cw-widget-instruction {
    background: #E8E8E8;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cw-widget-icon-small {
    width: 32px;
    height: 32px;
    background: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-widget-icon-small svg {
    width: 20px;
    height: 20px;
}

.cw-widget-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cw-widget-instruction p {
    margin: 0;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

.cw-widget-input,
.cw-widget-textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
}

.cw-widget-input:focus,
.cw-widget-textarea:focus {
    outline: none;
    border-color: #8B0000;
}

.cw-widget-textarea {
    resize: vertical;
    min-height: 70px;
    height: 70px !important;
}

.cw-phone-wrapper {
    display: flex !important;
    gap: 10px;
    margin-bottom: 15px;
    visibility: visible !important;
    opacity: 1 !important;
}

.cw-country-code {
    width: 140px;
    padding: 10px 8px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    line-height: 1.5;
    display: block;
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
}

.cw-country-code option {
    font-size: 15px;
    padding: 8px 5px;
    line-height: 1.8;
}

.cw-phone-input {
    flex: 1;
    margin-bottom: 0;
}

.cw-consent-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.cw-consent-wrapper input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8B0000;
}

.cw-consent-wrapper label {
    cursor: pointer;
    line-height: 1.4;
}

.cw-widget-submit {
    width: 100%;
    padding: 10px 20px;
    background-color: #8B0000;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.cw-widget-submit:hover {
    opacity: 0.9;
}

.cw-widget-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cw-message-result {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.cw-message-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.cw-message-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

@media (max-width: 480px) {
    #cw-chat-widget {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
    }
    
    .cw-chat-icon-wrapper {
        bottom: 30px;
        right: 15px;
    }
    
    .cw-chat-icon {
        width: 50px;
        height: 50px;
    }
    
    .cw-chat-tooltip {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 150px;
    }
}

