/**
 * SignaTech Destek Widget - Frontend styles
 * Eklenti kendi stillerini yükler; tema (nextcore) custom-design ile aynı sınıfları kullanır.
 */
:root {
    --widget-primary: #0976d4;
    --widget-primary-dark: #0761b0;
    --widget-secondary: #10b981;
    --widget-warning: #f59e0b;
    --widget-bg: #ffffff;
    --widget-text: #1f2937;
    --widget-text-muted: #6b7280;
    --widget-border: #e5e7eb;
    --widget-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --widget-radius: 16px;
    --widget-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.contact-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--widget-font);
}

.contact-widget__trigger {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--widget-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(9, 118, 212, 0.4), 0 0 0 0 rgba(9, 118, 212, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    overflow: visible;
}

.contact-widget__trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(9, 118, 212, 0.5), 0 0 0 0 rgba(9, 118, 212, 0.4);
}

.contact-widget__trigger:active {
    transform: scale(0.95);
}

.contact-widget__icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.contact-widget.active .contact-widget__icon {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

.contact-widget__trigger::before,
.contact-widget__trigger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-widget__trigger::before {
    transform: rotate(45deg) scale(0);
}

.contact-widget__trigger::after {
    transform: rotate(-45deg) scale(0);
}

.contact-widget.active .contact-widget__trigger::before,
.contact-widget.active .contact-widget__trigger::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.contact-widget.active .contact-widget__trigger::after {
    transform: rotate(-45deg) scale(1);
}

.contact-widget.active .contact-widget__icon {
    opacity: 0;
    transform: scale(0);
}

.contact-widget__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: sdw-badgePulse 2s ease-in-out infinite;
}

@keyframes sdw-badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.contact-widget.active .contact-widget__badge {
    opacity: 0;
    transform: scale(0);
}

.contact-widget__pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--widget-primary);
    opacity: 0;
    animation: sdw-pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes sdw-pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.8); opacity: 0; }
}

.contact-widget.active .contact-widget__pulse {
    animation: none;
    opacity: 0;
}

.contact-widget__popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-height: calc(100vh - 140px);
    background: var(--widget-bg);
    border-radius: var(--widget-radius);
    box-shadow: var(--widget-shadow);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-widget.active .contact-widget__popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.contact-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--widget-primary);
    color: #ffffff;
}

.contact-widget__header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-widget__header-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px;
}

.contact-widget__header-text {
    display: flex;
    flex-direction: column;
}

.contact-widget__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.contact-widget__subtitle {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.contact-widget__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.contact-widget__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.contact-widget__close svg {
    width: 18px;
    height: 18px;
}

.contact-widget__welcome {
    padding: 20px;
    background: #f9fafb;
    border-bottom: 1px solid var(--widget-border);
}

.contact-widget__message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
}

.contact-widget__message-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.contact-widget__message p {
    margin: 0;
    font-size: 0.938rem;
    color: var(--widget-text);
    line-height: 1.5;
}

.contact-widget__response-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ecfdf5;
    border-radius: 100px;
    font-size: 0.813rem;
    color: #059669;
}

.contact-widget__response-time svg {
    width: 14px;
    height: 14px;
    stroke: #059669;
}

.contact-widget__response-time strong {
    font-weight: 600;
}

.contact-widget__options {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.contact-widget__option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--widget-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--widget-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-widget__option:hover {
    border-color: var(--widget-primary);
    box-shadow: 0 4px 12px rgba(9, 118, 212, 0.1);
    transform: translateX(4px);
}

.contact-widget__option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-widget__option-icon svg {
    width: 24px;
    height: 24px;
}

.contact-widget__option-icon--sales {
    background: #ecfdf5;
    color: #059669;
}

.contact-widget__option-icon--sales svg {
    stroke: #059669;
}

.contact-widget__option-icon--support {
    background: #eff6ff;
    color: var(--widget-primary);
}

.contact-widget__option-icon--support svg {
    stroke: var(--widget-primary);
}

.contact-widget__option-icon--email {
    background: #fef3c7;
    color: #d97706;
}

.contact-widget__option-icon--email svg {
    stroke: #d97706;
}

.contact-widget__option-content {
    flex: 1;
    min-width: 0;
}

.contact-widget__option-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--widget-text);
    margin-bottom: 2px;
}

.contact-widget__option-desc {
    font-size: 0.813rem;
    color: var(--widget-text-muted);
    margin-bottom: 4px;
}

.contact-widget__option-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--widget-secondary);
    font-weight: 500;
}

.contact-widget__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: sdw-statusPulse 2s ease-in-out infinite;
}

.contact-widget__status-dot--online {
    background: var(--widget-secondary);
}

.contact-widget__status-dot--away {
    background: var(--widget-warning);
    animation: none;
}

@keyframes sdw-statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.contact-widget__option-arrow {
    width: 20px;
    height: 20px;
    color: #d1d5db;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.contact-widget__option:hover .contact-widget__option-arrow {
    color: var(--widget-primary);
    transform: translateX(4px);
}

.contact-widget__footer {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid var(--widget-border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--widget-text-muted);
}

.contact-widget__footer a {
    text-decoration: none;
    color: var(--widget-primary);
    font-weight: 600;
}

.contact-widget__footer a:hover {
    text-decoration: underline;
}

.contact-widget__footer strong {
    color: var(--widget-primary);
    font-weight: 600;
}

@media (max-width: 480px) {
    .contact-widget {
        bottom: 16px;
        right: 16px;
    }
    .contact-widget__trigger {
        width: 56px;
        height: 56px;
    }
    .contact-widget__icon {
        width: 30px;
        height: 30px;
    }
    .contact-widget__popup {
        width: calc(100vw - 32px);
        max-width: 360px;
        bottom: 72px;
        right: 0;
    }
    .contact-widget__header {
        padding: 16px;
    }
    .contact-widget__header-logo {
        width: 40px;
        height: 40px;
    }
    .contact-widget__title {
        font-size: 1rem;
    }
    .contact-widget__welcome {
        padding: 16px;
    }
    .contact-widget__options {
        padding: 10px;
    }
    .contact-widget__option {
        padding: 12px;
    }
    .contact-widget__option-icon {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-widget__trigger,
    .contact-widget__popup,
    .contact-widget__option,
    .contact-widget__badge,
    .contact-widget__pulse,
    .contact-widget__status-dot {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
