/**
 * Vins WhatsApp Widget - Frontend Styles
 * Developer: Kelvin K
 * Agency: Vins Creatives Agency (www.vinscreatives.com)
 */

/* Root Variables */
:root {
    --vins-ww-primary: #25D366;
    --vins-ww-primary-hover: #128C7E;
    --vins-ww-secondary: #075E54;
    --vins-ww-text-dark: #1f2937;
    --vins-ww-text-light: #6b7280;
    --vins-ww-border: #e5e7eb;
    --vins-ww-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --vins-ww-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --vins-ww-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
.vins-ww-widget-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.vins-ww-widget-container {
    position: relative;
    z-index: 999999;
}

/* Floating Widget Positioning */
.vins-ww-floating-widget {
    position: fixed;
    z-index: 999998;
    bottom: 20px;
}

.vins-ww-position-bottom-right {
    right: 20px;
}

.vins-ww-position-bottom-left {
    left: 20px;
}

/* Chat Button */
.vins-ww-chat-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--vins-ww-primary);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
    box-shadow: var(--vins-ww-shadow);
    transition: var(--vins-ww-transition);
    position: relative;
    overflow: hidden;
}

.vins-ww-chat-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.vins-ww-chat-button:hover::before {
    width: 300px;
    height: 300px;
}

.vins-ww-chat-button:hover {
    background: var(--vins-ww-primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 50px rgba(37, 211, 102, 0.4);
}

.vins-ww-chat-button:active {
    transform: translateY(-1px) scale(0.98);
}

.vins-ww-whatsapp-icon {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    position: relative;
    z-index: 1;
    animation: vins-ww-pulse 2s infinite;
}

@keyframes vins-ww-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.vins-ww-button-text {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* Chat Modal */
.vins-ww-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vins-ww-chat-modal.vins-ww-active {
    opacity: 1;
    visibility: visible;
}

.vins-ww-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--vins-ww-shadow-lg);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vins-ww-chat-modal.vins-ww-active .vins-ww-modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.vins-ww-modal-header {
    background: linear-gradient(135deg, var(--vins-ww-primary) 0%, var(--vins-ww-primary-hover) 100%);
    color: #ffffff;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.vins-ww-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.vins-ww-header-content {
    display: flex;
    gap: 16px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.vins-ww-whatsapp-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vins-ww-whatsapp-avatar svg {
    width: 32px;
    height: 32px;
}

.vins-ww-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.vins-ww-modal-subtitle {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
    line-height: 1.4;
}

.vins-ww-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: var(--vins-ww-transition);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.vins-ww-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.vins-ww-modal-body {
    padding: 32px 24px;
}

/* Form Styles */
.vins-ww-chat-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vins-ww-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vins-ww-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--vins-ww-text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.vins-ww-label .required {
    color: #ef4444;
}

.vins-ww-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--vins-ww-border);
    border-radius: 12px;
    outline: none;
    transition: var(--vins-ww-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
}

.vins-ww-input:focus {
    border-color: var(--vins-ww-primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.vins-ww-input.vins-ww-error-input {
    border-color: #ef4444;
}

/* Textarea Styles */
.vins-ww-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
}

/* Image Upload Styles */
.vins-ww-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f9fafb;
    border: 2px dashed var(--vins-ww-border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--vins-ww-transition);
    color: var(--vins-ww-text-dark);
    font-weight: 600;
    justify-content: center;
}

.vins-ww-upload-label:hover {
    background: #f3f4f6;
    border-color: var(--vins-ww-primary);
    color: var(--vins-ww-primary);
}

.vins-ww-upload-label svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.vins-ww-file-input {
    display: none;
}

/* Image Previews */
.vins-ww-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.vins-ww-image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--vins-ww-border);
    background: #f9fafb;
}

.vins-ww-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vins-ww-image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: var(--vins-ww-transition);
    padding: 0;
}

.vins-ww-image-preview-remove:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.vins-ww-image-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vins-ww-image-preview-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid rgba(37, 211, 102, 0.3);
    border-top-color: var(--vins-ww-primary);
    border-radius: 50%;
    animation: vins-ww-spin 0.6s linear infinite;
}

.vins-ww-error {
    color: #ef4444;
    font-size: 13px;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.vins-ww-error.vins-ww-show {
    display: block;
}

/* Submit Button */
.vins-ww-submit-button {
    background: var(--vins-ww-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
    transition: var(--vins-ww-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.vins-ww-submit-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.vins-ww-submit-button:hover::before {
    width: 300px;
    height: 300px;
}

.vins-ww-submit-button:hover {
    background: var(--vins-ww-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.vins-ww-submit-button:active {
    transform: translateY(0);
}

.vins-ww-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.vins-ww-submit-icon {
    position: relative;
    z-index: 1;
}

.vins-ww-submit-button span {
    position: relative;
    z-index: 1;
}

/* Privacy Text */
.vins-ww-privacy-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--vins-ww-text-light);
    text-align: center;
    justify-content: center;
    margin-top: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.vins-ww-privacy-text svg {
    flex-shrink: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .vins-ww-floating-widget {
        bottom: 15px;
    }
    
    .vins-ww-position-bottom-right {
        right: 15px;
    }
    
    .vins-ww-position-bottom-left {
        left: 15px;
    }
    
    .vins-ww-chat-button {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .vins-ww-whatsapp-icon {
        width: 22px;
        height: 22px;
    }
    
    .vins-ww-chat-modal {
        padding: 15px;
    }
    
    .vins-ww-modal-content {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .vins-ww-modal-header {
        padding: 20px;
    }
    
    .vins-ww-whatsapp-avatar {
        width: 48px;
        height: 48px;
    }
    
    .vins-ww-whatsapp-avatar svg {
        width: 28px;
        height: 28px;
    }
    
    .vins-ww-modal-title {
        font-size: 18px;
    }
    
    .vins-ww-modal-subtitle {
        font-size: 13px;
    }
    
    .vins-ww-modal-body {
        padding: 24px 20px;
    }
}

@media screen and (max-width: 480px) {
    .vins-ww-hide-mobile {
        display: none !important;
    }
    
    .vins-ww-chat-button .vins-ww-button-text {
        display: none;
    }
    
    .vins-ww-chat-button {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    
    .vins-ww-modal-header {
        padding: 16px;
    }
    
    .vins-ww-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .vins-ww-modal-body {
        padding: 20px 16px;
    }
    
    .vins-ww-input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .vins-ww-textarea {
        min-height: 80px;
    }
    
    .vins-ww-image-preview {
        width: 70px;
        height: 70px;
    }
    
    .vins-ww-submit-button {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Loading State */
.vins-ww-loading {
    position: relative;
}

.vins-ww-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-color: #ffffff;
    border-radius: 50%;
    animation: vins-ww-spin 0.6s linear infinite;
}

@keyframes vins-ww-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes vins-ww-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vins-ww-widget-container {
    animation: vins-ww-fadeIn 0.5s ease;
}

/* Accessibility */
.vins-ww-chat-button:focus,
.vins-ww-close-button:focus,
.vins-ww-submit-button:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.vins-ww-input:focus {
    outline: none;
}

/* Print Styles */
@media print {
    .vins-ww-widget-container,
    .vins-ww-floating-widget {
        display: none !important;
    }
}


