﻿/* ==========================================================================
    File        : help-footer.css
    Component   : Floating Help Footer
    Version     : 1.0
    Author      : ChatGPT
    Description : Production ready floating help widget.
========================================================================== */

/* ==========================================================================
   CSS VARIABLES
========================================================================== */
:root {
    /*--------------------------------------------------------------
        Brand Colors
    --------------------------------------------------------------*/
    --hf-primary: #d7261e;
    --hf-primary-hover: #bf1e17;
    --hf-success: #16a34a;
    --hf-success-hover: #15803d;
    --hf-warning: #ffb000;
    --hf-dark: #1f2937;
    --hf-text: #222222;
    --hf-text-light: #666666;
    --hf-white: #ffffff;
    --hf-border: #e5e7eb;
    --hf-shadow: 0 18px 40px rgba(0,0,0,.18);
    --hf-shadow-hover: 0 28px 60px rgba(0,0,0,.25);
    /*--------------------------------------------------------------
        Sizes
    --------------------------------------------------------------*/
    --hf-width: 340px;
    --hf-radius: 22px;
    --hf-padding: 22px;
    --hf-gap: 16px;
    --hf-transition: .35s cubic-bezier(.4,0,.2,1);
    --hf-zindex: 99999;
    /*--------------------------------------------------------------
        Sticky Position
    --------------------------------------------------------------*/
    --hf-right: 24px;
    --hf-bottom: 24px;
    /*--------------------------------------------------------------
        Collapse
    --------------------------------------------------------------*/
    --hf-mini-size: 72px;
    /*--------------------------------------------------------------
        Typography
    --------------------------------------------------------------*/
    --hf-font: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}


/* ==========================================================================
   RESET
========================================================================== */
.help-footer *,
.help-footer *::before,
.help-footer *::after {
    box-sizing: border-box;
}

.help-footer button {
    font: inherit;
}

.help-footer a {
    text-decoration: none;
}

.help-footer img {
    display: block;
    max-width: 100%;
}

/* ==========================================================================
   ROOT CONTAINER
========================================================================== */
.help-footer {
    position: fixed;
    right: var(--hf-right);
    bottom: var(--hf-bottom);
    width: var(--hf-width);
    z-index: var(--hf-zindex);
    font-family: var(--hf-font);
    pointer-events: none;
    transform: translate3d(0,120px,0);
    opacity: 0;
    transition: transform .55s cubic-bezier(.22,1,.36,1), opacity .55s ease;
    will-change: transform, opacity;
}
    /* JS yüklenince */
    .help-footer.is-visible {
        opacity: 1;
        transform: translate3d(0,0,0);
    }

/* ==========================================================================
   GENERAL LAYOUT
========================================================================== */
/* Üst bilgi */
.help-footer__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Başlık */
.help-footer__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--hf-text);
    line-height: 1.3;
}

/* Kpatama (min) butonu için*/
.help-footer__header {
    position: relative;
}

/* Kpatama (min) butonu */
.help-footer__close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .25s;
    font-weight: 900;
}

    .help-footer__close:hover {
        background: #e5e7eb;
        color: #111;
    }

    .help-footer__close svg {
        width: 20px;
        height: 20px;
        font-weight: bolder;
    }

/* Durum satırı */
.help-footer__status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Yeşil nokta */
.help-footer__status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hf-success);
    flex: none;
}

/* Durum yazısı */
.help-footer__status-text {
    font-size: 13px;
    color: var(--hf-success);
    font-weight: 600;
}

/* Ortalama süre */
.help-footer__eta {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #fff8e8;
    color: #8a5b00;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   TOGGLE BUTTON / MINI VEHICLE ICON
========================================================================== */
.help-footer__toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 105px;
    height: 105px;
    border: none;
    background: #ffffff00; /*linear-gradient(to right, #d4fc79, #76b852);*/
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
    transition: transform var(--hf-transition), box-shadow var(--hf-transition);
    z-index: 5;
}

/* Mini mod aktif olduğunda */
.help-footer.is-collapsed .help-footer__toggle {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.help_footer__toggle_img {
    transform: scaleX(-1) scale(1) ;
    transition: transform 0.3s ease;
    object-fit: cover;
}

    .help_footer__toggle_img:hover {
        transform: scaleX(-1) scale(1.5);
    }

/* ==========================================================================
   PANEL
========================================================================== */
.help-footer__panel {
    background: var(--hf-white);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius);
    padding: var(--hf-padding);
    box-shadow: var(--hf-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: opacity var(--hf-transition), transform var(--hf-transition), visibility var(--hf-transition);
}

/* Collapse sırasında panel gizlenir */
.help-footer.is-collapsed .help-footer__panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(30px) scale(.95);
}

/* ==========================================================================
   STATUS INDICATOR
========================================================================== */
.help-footer__status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-footer__status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--hf-success);
    animation: hf-status-pulse 2.8s infinite;
}

.help-footer__status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--hf-success);
}

/* ==========================================================================
   ETA BOX
========================================================================== */
.help-footer__eta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border-radius: 16px;
    background: linear-gradient( 135deg, #fff7ed, #fffbeb );
}

.help-footer__eta-content {
    display: flex;
    flex-direction: column;
}

.help-footer__eta-label {
    font-size: 12px;
    color: #78716c;
}

.help-footer__eta-value {
    font-size: 17px;
    color: #92400e;
}

/* ==========================================================================
   BODY CONTENT
========================================================================== */
.help-footer__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.help-footer__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--hf-text);
}

.help-footer__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--hf-text-light);
}

/* ==========================================================================
   ACTION BUTTONS
========================================================================== */
.help-footer__action {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

    .help-footer__action:hover {
        transform: translateY(-3px);
    }

    .help-footer__action:active {
        transform: scale(.98);
    }

.help-footer__action-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    flex: none;
}

.help-footer__action-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

    .help-footer__action-content strong {
        font-size: 15px;
    }

    .help-footer__action-content small {
        margin-top: 3px;
        font-size: 12px;
        opacity: .8;
    }

/* WhatsApp */
.help-footer__action--whatsapp {
    background: linear-gradient( 135deg, #16a34a, #22c55e );
    color: white;
    box-shadow: 0 12px 25px rgba(22,163,74,.3);
}

    .help-footer__action--whatsapp
    .help-footer__action-icon {
        background: rgba(255,255,255,.18);
    }

/* Location */
.help-footer__action--location {
    background: #f3f4f6;
    color: var(--hf-text);
}

    .help-footer__action--location
    .help-footer__action-icon {
        background: white;
    }

/* ==========================================================================
   FOOTER AREA
========================================================================== */
.help-footer__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--hf-border);
}

.help-footer__phone {
    font-weight: 700;
    color: var(--hf-primary);
    font-size: 14px;
}

.help-footer__service {
    font-size: 12px;
    color: var(--hf-text-light);
}

/* ==========================================================================
   ANIMATION KEYFRAMES
========================================================================== */
@keyframes hf-status-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22,163,74,.45);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(22,163,74,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(22,163,74,0);
    }
}

/* ==========================================================================
   OPEN / CLOSE ANIMATIONS
========================================================================== */
/*
    İlk yükleme animasyonu
    JS tarafından:
    <aside class="help-footer is-visible">
    yapıldığında aktif olur.
*/
.help-footer.is-visible {
    opacity: 1;
    transform: translate3d(0,0,0);
}

/* Panel görünümü */
.help-footer__panel {
    transform-origin: bottom right;
    transition: opacity var(--hf-transition), transform var(--hf-transition), visibility var(--hf-transition);
}

/* ==========================================================================
   COLLAPSE STATE
========================================================================== */
/*
    Scroll sonrası:
    data-state="collapsed"
    durumunda sadece araç butonu görünür.
*/
.help-footer[data-state="collapsed"] {
    width: auto;
}

    .help-footer[data-state="collapsed"]
    .help-footer__panel {
        opacity: 0;
        transform: translateY(20px) scale(.92);
        pointer-events: none;
    }

.help-footer[data-state="expanded"]
.help-footer__panel {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.help-footer[data-state="expanded"]
.help-footer__toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
}

.help-footer[data-state="collapsed"]
.help-footer__toggle {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Toggle icon */
.help-footer__toggle-icon {
    width: 38px;
    height: 38px;
}

/* ==========================================================================
   ACTION BUTTONS
========================================================================== */
.help-footer__action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

    .help-footer__action:hover {
        transform: translateY(-2px);
    }

.help-footer__action-icon {
    width: 42px;
    height: 42px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
}

.help-footer__action-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

    .help-footer__action-content strong {
        font-size: 15px;
        line-height: 1.3;
    }

    .help-footer__action-content small {
        margin-top: 3px;
        font-size: 12px;
        opacity: .75;
    }

/* WhatsApp */
.help-footer__action--whatsapp {
    background: #25D366;
    color: white;
}

    .help-footer__action--whatsapp:hover {
        background: #20bd5a;
    }

/* Konum */
.help-footer__action--location {
    margin-top: 10px;
    background: #f3f4f6;
    color: var(--hf-dark);
}

/* ==========================================================================
   FOOTER PHONE AREA
========================================================================== */
.help-footer__footer {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.help-footer__phone {
    font-size: 18px;
    font-weight: 700;
    color: var(--hf-primary);
}

.help-footer__service {
    font-size: 13px;
    color: var(--hf-text-light);
}

/* ===========================================================
   Working Hours
=========================================================== */

.help-footer.is-closed .help-footer__status-dot {
    background: #dc2626;
}

.help-footer.is-closed .help-footer__status-text {
    color: #dc2626;
}

.help-footer.is-closed .help-footer__eta {
    display: none;
}

.help-footer.is-closed .help-footer__action {
    display: none;
}

.help-footer.is-closed .help-footer__title {
    color: #444;
}

.help-footer.is-closed .help-footer__text {
    color: #666;
}

/* ==========================================================================
   RESPONSIVE DESIGN
========================================================================== */
/* Mobile 320px - 480px */
@media (max-width:480px) {
    :root {
        --hf-right: 14px;
        --hf-bottom: 14px;
        --hf-width: calc(100vw - 28px);
        --hf-padding: 18px;
    }

    .help-footer {
        width: var(--hf-width);
    }

    .help-footer__panel {
        border-radius: 18px;
    }

    .help-footer__title {
        font-size: 17px;
    }

    .help-footer__eta {
        font-size: 13px;
    }

    .help-footer__toggle {
        width: 64px;
        height: 64px;
    }
}

/* Tablet 768px+ */
@media (min-width:768px) {
    :root {
        --hf-width: 360px;
    }
}

/* ==========================================================================
   DARK MODE
========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --hf-text: #f9fafb;
        --hf-text-light: #cbd5e1;
        --hf-border: #374151;
    }

    .help-footer__panel {
        background: #111827;
        border-color: #374151;
    }

    .help-footer__action--location {
        background: #1f2937;
        color: #f9fafb;
    }

    .help-footer__service {
        color: #94a3b8;
    }
}

/* ==========================================================================
   REDUCED MOTION ACCESSIBILITY
========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .help-footer,
    .help-footer *,
    .help-footer *::before,
    .help-footer *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   SAFE AREA SUPPORT
========================================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
    .help-footer {
        bottom: calc( var(--hf-bottom) + env(safe-area-inset-bottom) );
    }
}

/* ==========================================================================
   HIGH DPI OPTIMIZATION
========================================================================== */
@media (-webkit-min-device-pixel-ratio:2), (min-resolution:192dpi) {
    .help-footer__panel {
        border-width: .5px;
    }

}
