/**
 * Halfords Careers Chat — chat-widget styles (Hal).
 * The holding page itself is styled by hcc-home.css; this file provides the
 * floating widget (#hal-toggle / #hal-panel / #hal-bubble) and shared bits.
 */

/* ===== Base overrides ===== */

body {
    font-family: 'Open Sans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #1d1d1b;
    -webkit-font-smoothing: antialiased;
}

/* Remove the FOUC guard the original site used */
.preventFOUC { display: block !important; }

/* Make the hero visible without JS slick carousel */
.slider.home-slider {
    visibility: visible !important;
    position: relative;
    overflow: hidden;
}

.slider.home-slider .slide {
    display: block !important;
}

.slider.home-slider .slideInternal {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
}

.slider.home-slider .slideInternal picture {
    display: block;
    width: 100%;
}

.slider.home-slider .slideInternal picture img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.slider.home-slider .text-box-01 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
}

.slider.home-slider .text-box-02 {
    max-width: 1200px;
    margin: 0 auto;
}

.slider.home-slider .text-box-02 p {
    font-family: 'Open Sans', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
    line-height: 1.1;
}

@media (max-width: 767px) {
    .slider.home-slider .text-box-02 p {
        font-size: 28px;
    }
    .slider.home-slider .slideInternal {
        min-height: 300px;
    }
}

/* ===== Featured jobs static grid ===== */

.static-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.job-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.job-box:hover {
    box-shadow: 0 4px 16px rgba(0, 40, 40, 0.12);
    transform: translateY(-2px);
}

.job-box h3 {
    font-family: 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1b;
    margin: 0 0 8px;
}

.job-box .location {
    font-size: 14px;
    color: #555;
    margin: 0 0 4px;
}

.job-box .type {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
}

.job-box .button.anim {
    display: inline-block;
    font-size: 14px;
}

/* ===== Chatbot widget ===== */

#hal-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #EE3124;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    min-height: 48px;
    min-width: 48px;
}

#hal-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Shake animation to draw attention */
@keyframes pawShake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-12deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-8deg); }
    40% { transform: rotate(6deg); }
    50% { transform: rotate(-3deg); }
    60% { transform: rotate(0deg); }
}

#hal-toggle.shake {
    animation: pawShake 0.8s ease-in-out;
}

/* Notification bubble */
#hal-bubble {
    position: fixed;
    bottom: 92px;
    right: 24px;
    background: #ffffff;
    color: #1d1d1b;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    max-width: 260px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#hal-bubble.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

#hal-bubble .bubble-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

#hal-toggle:focus-visible {
    outline: 3px solid #0059AB;
    outline-offset: 3px;
}

#hal-toggle svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

/* Chat panel */
#hal-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#hal-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Panel header */
#hal-panel .chat-header {
    background: #1d1d1b;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#hal-panel .chat-header h3 {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

#hal-panel .chat-header h3 .header-icon {
    width: 22px;
    height: 22px;
    fill: #EE3124;
}

#hal-panel .chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hal-panel .chat-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

#hal-panel .chat-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Messages area */
#hal-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

#hal-panel .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#hal-panel .chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#hal-panel .chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Message bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: fadeInMsg 0.2s ease;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    align-self: flex-start;
    background: #f0f0f0;
    color: #1d1d1b;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
    background: #EE3124;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Markdown rendering inside messages */
.chat-msg strong, .chat-msg b {
    font-weight: 700;
}

.chat-msg em, .chat-msg i {
    font-style: italic;
}

.chat-msg ul, .chat-msg ol {
    margin: 6px 0 6px 18px;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
}

.chat-msg li {
    margin-bottom: 4px;
    font-size: inherit;
    line-height: inherit;
}

.chat-msg p {
    margin: 0 0 8px;
    font-size: inherit;
    line-height: inherit;
}

.chat-msg p:last-child {
    margin-bottom: 0;
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    background: #f0f0f0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 12px 20px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    display: block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
#hal-panel .chat-input-area {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

#hal-panel .chat-input-area textarea {
    flex: 1;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

#hal-panel .chat-input-area textarea:focus {
    border-color: #EE3124;
}

#hal-panel .chat-input-area textarea::placeholder {
    color: #aaa;
}

#hal-panel .chat-send {
    background: #EE3124;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 48px;
    min-height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#hal-panel .chat-send:hover {
    background: #008f22;
}

#hal-panel .chat-send:focus-visible {
    outline: 3px solid #0059AB;
    outline-offset: 2px;
}

#hal-panel .chat-send svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

/* Disclaimer */
#hal-panel .chat-disclaimer {
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 8px 16px;
    font-size: 11px;
    color: #888;
    text-align: center;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ===== Mobile responsive for chat ===== */
@media (max-width: 479px) {
    #hal-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #hal-toggle {
        bottom: 16px;
        right: 16px;
    }

    /* Prevent iOS zoom on input focus - must be 16px minimum */
    #hal-panel .chat-input-area textarea {
        font-size: 16px;
    }

    /* Slightly larger touch-friendly text on mobile */
    .chat-msg {
        font-size: 14px;
        padding: 12px 14px;
    }
}

/* ===== Utility: ensure images load eagerly without lazysizes JS ===== */
img.lazyload {
    opacity: 1 !important;
}

/* Ensure hero slider is properly sized without Slick JS */
.home-slider .slick-list,
.home-slider .slick-track {
    display: block;
}

.bannerSlideAjaxLoader {
    display: none;
}

