/**
 * Sticky Contact Widget Styles
 * File: features/sticky-contact/sticky-contact.css
 * 
 * Modern, accessible sticky contact widget
 * Compatible with brand color system
 */

/* ========== STICKY WIDGET BASE ========== */
.sticky-contact-widget {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    transition: all var(--duration-normal) var(--ease-smooth);
}

/* Position variants */
.sticky-contact-widget.position-bottom-right {
    right: 1rem;
    bottom: 1rem;
}

.sticky-contact-widget.position-bottom-left {
    left: 1rem;
    bottom: 1rem;
    align-items: flex-start;
}

.sticky-contact-widget.position-bottom-left .contact-form-popup {
    right: auto;
    left: calc(100% + 1rem);
}

.sticky-contact-widget.position-bottom-left .sticky-contact-text {
    right: auto;
    left: calc(100% + 0.75rem);
}

.sticky-contact-widget.position-bottom-left .sticky-contact-text::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: var(--color-neutral-800);
}


/* When minimized, hide everything except the minimize button */
.sticky-contact-widget.minimized {
    /* Optionally, keep the widget in place */
    transform: none;
}
.sticky-contact-widget.minimized > *:not(.sticky-minimize-btn) {
    display: none !important;
}
.sticky-contact-widget.minimized .sticky-minimize-btn {
    display: flex !important;
}
.sticky-contact-widget.minimized .minimize-icon svg {
    transform: rotate(180deg);
}

/* ========== MINIMIZE BUTTON ========== */

/* Sticky Minimize Button - Black and Centered */
.sticky-minimize-btn {
    background: #3e435e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.7rem;
    height: 2.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: all var(--duration-normal) var(--ease-smooth);
    order: 2;
    margin-right: 0.15rem;
    margin-left: 0.1rem;
    position: relative;
    z-index: 2;
}

.sticky-minimize-btn:hover {
    background: #3e3d6d;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    transform: scale(1.07);
}

.sticky-minimize-btn:focus {
    outline: 2px solid var(--color-primary-300);
    outline-offset: 2px;
}

.minimize-icon svg {
    transition: transform var(--duration-normal) var(--ease-smooth);
}

/* ========== CONTACT LIST ========== */
.sticky-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.sticky-contact-item {
    position: relative;
}

.sticky-contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all var(--duration-normal) var(--ease-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.sticky-contact-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sticky-contact-icon:focus {
    outline: 2px solid var(--color-primary-300);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(92, 225, 230, 0.2), 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Add backdrop blur for better visibility */
.sticky-contact-widget::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}


/* ========== CONTACT ITEM SPECIFIC COLORS ========== */
.contact-form-item .sticky-contact-icon {
    background: linear-gradient(135deg, #00E5FF, #00BCD4, #0097A7);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.5), 0 2px 8px rgba(0, 188, 212, 0.3), 0 0 20px rgba(0, 229, 255, 0.2);
    animation: contactGlow 2s ease-in-out infinite alternate;
    position: relative;
}

/* Attention Popup for Contact Form */
.contact-form-item .attention-popup {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0);
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.contact-form-item .attention-popup::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--color-primary-600);
}

.contact-form-item .attention-popup.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: popupBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.contact-form-item .attention-popup.hide {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
    transition: all 0.2s ease-out;
}

/* Enhanced glow when popup is active */
.contact-form-item.has-popup .sticky-contact-icon {
    animation: contactGlowAttention 1.5s ease-in-out infinite alternate;
}

/* Left positioned widget adjustments */
.sticky-contact-widget.position-bottom-left .contact-form-item .attention-popup {
    right: auto;
    left: calc(100% + 12px);
}

.sticky-contact-widget.position-bottom-left .contact-form-item .attention-popup::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: var(--color-primary-600);
}

.contact-form-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #00BCD4, #0097A7, #00796B);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.6), 0 4px 12px rgba(0, 188, 212, 0.4), 0 0 30px rgba(0, 229, 255, 0.3);
    animation: contactGlowHover 1.5s ease-in-out infinite alternate;
}

.whatsapp-item .sticky-contact-icon {
    background: linear-gradient(135deg, #25D366, #128C7E);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.whatsapp-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #128C7E, #075E54);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.phone-item .sticky-contact-icon {
    background: linear-gradient(135deg, #4CAF50, #388E3C, #2E7D32);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5), 0 2px 8px rgba(56, 142, 60, 0.3), 0 0 15px rgba(76, 175, 80, 0.2);
}

.phone-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #388E3C, #2E7D32, #1B5E20);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6), 0 4px 12px rgba(56, 142, 60, 0.4), 0 0 25px rgba(76, 175, 80, 0.3);
}

.instagram-item .sticky-contact-icon {
    background: linear-gradient(135deg, #E4405F, #C13584);
    box-shadow: 0 4px 12px rgba(228, 64, 95, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.instagram-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #C13584, #833AB4);
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.facebook-item .sticky-contact-icon {
    background: linear-gradient(135deg, #1877F2, #166FE5);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.facebook-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #166FE5, #1464D6);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.youtube-item .sticky-contact-icon {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.youtube-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #CC0000, #990000);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tiktok-item .sticky-contact-icon {
    background: linear-gradient(135deg, #000000, #333333);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(255, 255, 255, 0.1);
}

.tiktok-item .sticky-contact-icon:hover {
    background: linear-gradient(135deg, #333333, #000000);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* ========== CONTACT TEXT (TOOLTIP) ========== */
.sticky-contact-text {
    position: absolute;
    right: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-neutral-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-fast) var(--ease-smooth);
    pointer-events: none;
    z-index: 1000;
}

.sticky-contact-text::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--color-neutral-800);
}

.sticky-contact-icon:hover .sticky-contact-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-4px);
}

/* ========== CONTACT FORM POPUP ========== */
.contact-form-popup {
    position: absolute;
    right: calc(100% + 1rem);
    bottom: 0;
    width: 20rem;
    max-width: calc(100vw - 2rem);
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem) scale(0.95);
    transition: all var(--duration-normal) var(--ease-smooth);
    z-index: 1001;
    border: 1px solid var(--color-neutral-200);
}

.contact-form-item.active .contact-form-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.contact-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-neutral-200);
    background: linear-gradient(135deg, var(--color-primary-50), var(--color-primary-100));
    border-radius: 0.75rem 0.75rem 0 0;
}

.contact-form-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary-700);
}

.contact-form-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-neutral-500);
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.contact-form-close:hover {
    color: var(--color-neutral-700);
    background: var(--color-neutral-100);
}

.contact-form-body {
    padding: 1.25rem;
}

/* ========== FORM STYLES ========== */
.sticky-contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sticky-contact-form .form-group {
    margin-bottom: 0.75rem;
}

.sticky-contact-form .form-input,
.sticky-contact-form .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid #B3E5FC;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all var(--duration-fast) var(--ease-smooth);
    background: #E0F7FA !important;
    color: #333333;
}

.sticky-contact-form .form-input:focus,
.sticky-contact-form .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(92, 225, 230, 0.1);
}

.sticky-contact-form .form-textarea {
    resize: vertical;
    min-height: 4rem;
}

.sticky-contact-form .form-actions {
    margin-top: 1rem;
}

.sticky-contact-form .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}


/* Shiny turquoise for form submit button - HIGHEST SPECIFICITY */
.sticky-contact-form .btn.btn-primary.form-submit-btn {
    background: var(--color-primary-300) !important;
    color: #333333 !important;
    box-shadow: 0 4px 16px rgba(92, 225, 230, 0.25), 0 0 16px #B3E5FC !important;
    border: none !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 8px rgba(255,255,255,0.25) !important;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s !important;
    transform: none !important;
}

.sticky-contact-form .btn.btn-primary.form-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4DD0E1, #26C6DA, #00BCD4) !important;
    color: #333333 !important;
    box-shadow: 0 8px 32px rgba(92, 225, 230, 0.35), 0 0 24px #4DD0E1 !important;
    transform: translateY(-1px) !important;
}

.sticky-contact-form .btn.btn-primary.form-submit-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* REMOVE CONFLICTING RULES - These were overriding our custom button */
/* .sticky-contact-form .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 225, 230, 0.3);
}

.sticky-contact-form .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
} */

/* ========== FORM RESPONSE ========== */
.form-response {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.form-response.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.form-response.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.form-response.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ========== SUCCESS MESSAGE ========== */
.success-message {
    text-align: center;
    padding: 1.5rem;
}

.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.success-icon svg {
    color: #22c55e;
}

.success-message h4 {
    margin: 0 0 0.5rem 0;
    color: #15803d;
    font-size: 1.125rem;
    font-weight: 600;
}

.success-message p {
    margin: 0;
    color: var(--color-neutral-600);
    font-size: 0.875rem;
}

/* ========== LOADING SPINNER ========== */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== CONTACT FORM GLOWING ANIMATIONS ========== */
@keyframes contactGlow {
    0% {
        box-shadow: 0 4px 12px rgba(0, 229, 255, 0.5), 0 2px 8px rgba(0, 188, 212, 0.3), 0 0 20px rgba(0, 229, 255, 0.2);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 229, 255, 0.7), 0 2px 8px rgba(0, 188, 212, 0.5), 0 0 30px rgba(0, 229, 255, 0.4);
    }
}

@keyframes contactGlowHover {
    0% {
        box-shadow: 0 8px 25px rgba(0, 229, 255, 0.6), 0 4px 12px rgba(0, 188, 212, 0.4), 0 0 30px rgba(0, 229, 255, 0.3);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 229, 255, 0.8), 0 4px 12px rgba(0, 188, 212, 0.6), 0 0 40px rgba(0, 229, 255, 0.5);
    }
}

@keyframes contactGlowAttention {
    0% {
        box-shadow: 0 4px 12px rgba(0, 229, 255, 0.7), 0 2px 8px rgba(0, 188, 212, 0.5), 0 0 25px rgba(0, 229, 255, 0.4);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 6px 20px rgba(0, 229, 255, 0.9), 0 3px 12px rgba(0, 188, 212, 0.7), 0 0 35px rgba(0, 229, 255, 0.6);
        transform: scale(1.05);
    }
}

@keyframes popupBounce {
    0% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
    60% {
        transform: translateY(-50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* ========== SCREEN READER ONLY ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sticky-contact-widget {
        right: 0.75rem;
        bottom: 0.75rem;
    }
    
    .contact-form-popup {
        width: calc(100vw - 4rem);
        right: calc(-100vw + 6rem);
        bottom: auto;
        top: auto;
        position: fixed;
        left: 1rem;
        right: 1rem;
        width: auto;
        bottom: 6rem;
    }
    
    .sticky-contact-text {
        display: none; /* Hide tooltips on mobile */
    }
    
    /* Mobile attention popup adjustments */
    .contact-form-item .attention-popup {
        font-size: 0.7rem;
        padding: 6px 10px;
        right: calc(100% + 8px);
        border-radius: 16px;
    }
    
    .contact-form-item .attention-popup::after {
        border-width: 5px;
    }
    
    .sticky-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .sticky-contact-widget {
        right: 0.5rem;
        bottom: 0.5rem;
    }
    
    .sticky-contact-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
    
    .sticky-minimize-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    /* Extra small mobile attention popup */
    .contact-form-item .attention-popup {
        font-size: 0.65rem;
        padding: 5px 8px;
        border-radius: 14px;
        right: calc(100% + 6px);
    }
    
    .contact-form-item .attention-popup::after {
        border-width: 4px;
    }
}
