/* HMC PC Health Chat Widget - Light Blue Design */

/* Base styles for phones (narrowest screen first) */
.hmc-chat-widget {
    position: fixed;
    bottom: clamp(1rem, 2dvh, 2.5rem);
    right: clamp(1rem, 2vw, 2.5rem);
    z-index: 10001;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Mobile-First Chat Button */
.hmc-chat-button {
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10002;
}

.hmc-chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.hmc-chat-button.active {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

.hmc-chat-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.hmc-chat-button i {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.hmc-chat-label {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    font-weight: 600;
    line-height: 1;
}

.hmc-chat-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* MOBILE CHAT WINDOW - Full Screen Experience */
.hmc-chat-window {
    position: fixed;
    inset-block-end: 0;
    inset-inline-end: 0;
    width: 100dvw;
    height: 100dvh;
    background: white;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10003;
    overflow: hidden;
}

.hmc-chat-window.active {
    transform: translateY(0);
}

/* Mobile Header */
.hmc-chat-header {
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    color: white;
    padding: clamp(1.2rem, 3vh, 1.8rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hmc-chat-header-content {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 2vw, 1.2rem);
    flex: 1;
}

.hmc-chat-logo {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    backdrop-filter: blur(10px);
}

.hmc-chat-title {
    flex: 1;
}

.hmc-chat-title h4 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    color: white;
}

.hmc-chat-title p {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.hmc-chat-close {
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hmc-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Messages Area */
.hmc-chat-messages {
    flex: 1;
    padding: clamp(1rem, 3vh, 1.5rem);
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 2vh, 1.2rem);
}

.hmc-message {
    display: flex;
    gap: clamp(0.6rem, 2vw, 0.8rem);
    align-items: flex-start;
}

.hmc-message.hmc-bot {
    align-self: flex-start;
}

.hmc-message.hmc-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.hmc-bot-avatar {
    width: clamp(32px, 6vw, 40px);
    height: clamp(32px, 6vw, 40px);
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    flex-shrink: 0;
}

.hmc-message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hmc-message-text {
    padding: clamp(0.8rem, 2vh, 1rem) clamp(1rem, 3vw, 1.2rem);
    border-radius: clamp(12px, 3vw, 16px);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.4;
    word-wrap: break-word;
}

.hmc-bot .hmc-message-text {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.hmc-user .hmc-message-text {
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    color: white;
}

.hmc-message-time {
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: #9ca3af;
    align-self: flex-end;
    margin-top: 0.2rem;
}

/* Welcome Features Grid */
.hmc-welcome-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(0.2rem, 0.8vw, 0.4rem);
    margin-top: clamp(0.4rem, 0.8vh, 0.6rem);
}

.hmc-feature:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
}

.hmc-feature:nth-child(6) {
    grid-column: 2;
    grid-row: 2;
}

.hmc-feature {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: clamp(0.3rem, 0.8vh, 0.5rem);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    font-size: clamp(0.55rem, 1.2vw, 0.65rem);
    color: #374151;
}

.hmc-feature:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Input Container */
.hmc-chat-input-container {
    padding: clamp(1rem, 3vh, 1.5rem);
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 2vh, 1rem);
}

.hmc-chat-input-wrapper {
    display: flex;
    gap: clamp(0.6rem, 2vw, 0.8rem);
    align-items: center;
}

.hmc-chat-input {
    flex: 1;
    padding: clamp(0.8rem, 2vh, 1rem) clamp(1rem, 3vw, 1.2rem);
    border: 2px solid #d1d5db;
    border-radius: 25px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    outline: none;
    transition: all 0.3s ease;
    background: white;
    color: #1f2937;
}

.hmc-chat-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.hmc-chat-input::placeholder {
    color: #9ca3af;
}

.hmc-chat-send {
    width: clamp(44px, 10vw, 48px);
    height: clamp(44px, 10vw, 48px);
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hmc-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hmc-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}



/* Typing Indicator */
.hmc-typing-indicator {
    display: flex;
    gap: 0.3rem;
    padding: clamp(0.8rem, 2vh, 1rem);
}

.hmc-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.hmc-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.hmc-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes hmcMobileChatOpen {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.hmc-chat-window.active {
    animation: hmcMobileChatOpen 0.3s ease-out;
}

/* DESKTOP STYLES */
@media (min-width: 768px) {
    .hmc-chat-window {
        width: 400px;
        height: 600px;
        bottom: 2rem;
        right: 2rem;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    }

    .hmc-chat-header {
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
    }

    .hmc-chat-logo {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .hmc-chat-title h4 {
        font-size: 1.2rem;
    }

    .hmc-chat-title p {
        font-size: 0.85rem;
    }

    .hmc-chat-messages {
        padding: 1.5rem;
    }

    .hmc-bot .hmc-message-text {
        max-width: 85%;
    }

    .hmc-message-time {
        font-size: 0.75rem;
    }

    .hmc-welcome-features {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .hmc-feature {
        padding: 0.4rem;
        font-size: 0.6rem;
    }

    .hmc-feature:hover {
        background: #f0f9ff;
    }

    .hmc-chat-input-container {
        padding: 1.5rem;
        border-radius: 0 0 20px 20px;
    }

    .hmc-chat-input {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }

    .hmc-chat-input:focus {
        border-color: #000000;
    }

    .hmc-chat-input::placeholder {
        color: #9ca3af;
    }


}

/* LARGE DESKTOP */
@media (min-width: 992px) {
    .hmc-chat-window {
        width: 450px;
        height: 650px;
    }

    .hmc-welcome-features {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 0.6rem;
    }
}

/* Prevent body scroll when chat is open */
.hmc-chat-window.active ~ body {
    overflow: hidden;
}

.hmc-chat-window.active {
    overflow: hidden;
}

/* Accessibility */
@media (prefers-contrast: high) {
    .hmc-chat-button {
        border: 2px solid white;
    }

    .hmc-chat-input {
        border-width: 3px;
    }

    .hmc-feature {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hmc-chat-window,
    .hmc-chat-button,
    .hmc-chat-send,
    .hmc-feature {
        transition: none;
    }

    .hmc-chat-pulse {
        animation: none;
    }

    .hmc-typing-dot {
        animation: none;
    }
} 