/* =====================================================
   ROCKY CHAT - Texas Got Rocks AI Assistant
   ===================================================== */

/* Chat Bubble - Bottom Right */
.rocky-chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm-orange, #FF6F00), var(--warm-orange-dark, #E65100));
    box-shadow: 0 4px 20px rgba(255, 111, 0, 0.4);
    cursor: pointer;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 3px solid white;
    overflow: hidden;
}

.rocky-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 111, 0, 0.5);
}

.rocky-chat-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.rocky-chat-bubble.has-notification::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background: var(--success-green, #2E7D32);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat bubble hint tooltip */
.rocky-chat-hint {
    position: fixed;
    bottom: 110px;
    right: 30px;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 14px;
    font-weight: 600;
    color: var(--earth-dark, #2C1810);
    z-index: 7999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 200px;
}

.rocky-chat-hint.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rocky-chat-hint::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 30px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* Chat Window */
.rocky-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 8001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.rocky-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.rocky-chat-header {
    background: linear-gradient(135deg, var(--warm-orange, #FF6F00), var(--warm-orange-dark, #E65100));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    flex-shrink: 0;
}

.rocky-chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.rocky-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.rocky-chat-header-info {
    flex: 1;
}

.rocky-chat-header-name {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.rocky-chat-header-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rocky-chat-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.rocky-chat-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rocky-chat-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Chat Messages Area */
.rocky-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9fafb;
}

/* Message Bubbles */
.rocky-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease;
}

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

.rocky-message.from-rocky {
    align-self: flex-start;
}

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

.rocky-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--warm-orange, #FF6F00);
}

.rocky-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.rocky-message.from-user .rocky-message-avatar {
    background: var(--earth-dark, #2C1810);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.rocky-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 14px;
    line-height: 1.5;
    color: var(--earth-dark, #2C1810);
}

.rocky-message.from-rocky .rocky-message-content {
    border-bottom-left-radius: 4px;
}

.rocky-message.from-user .rocky-message-content {
    background: var(--warm-orange, #FF6F00);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Quick Action Buttons */
.rocky-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rocky-quick-btn {
    padding: 8px 14px;
    background: white;
    border: 2px solid var(--warm-orange, #FF6F00);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--warm-orange, #FF6F00);
    cursor: pointer;
    transition: all 0.2s;
}

.rocky-quick-btn:hover {
    background: var(--warm-orange, #FF6F00);
    color: white;
}

/* Typing Indicator */
.rocky-typing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: fit-content;
}

.rocky-typing-dots {
    display: flex;
    gap: 4px;
}

.rocky-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--warm-orange, #FF6F00);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.rocky-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.rocky-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Chat Input Area */
.rocky-chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.rocky-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.rocky-chat-input:focus {
    border-color: var(--warm-orange, #FF6F00);
}

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

.rocky-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--warm-orange, #FF6F00);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.rocky-chat-send:hover {
    background: var(--warm-orange-dark, #E65100);
    transform: scale(1.05);
}

.rocky-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* Product Recommendation Card */
.rocky-product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.rocky-product-card:hover {
    border-color: var(--warm-orange, #FF6F00);
}

.rocky-product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.rocky-product-card-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--earth-dark, #2C1810);
}

.rocky-product-card-price {
    font-weight: 700;
    color: var(--warm-orange, #FF6F00);
    font-size: 14px;
}

.rocky-product-card-desc {
    font-size: 13px;
    color: var(--earth-brown, #5D4037);
    margin-bottom: 12px;
    line-height: 1.4;
}

.rocky-product-card-btn {
    width: 100%;
    padding: 10px;
    background: var(--warm-orange, #FF6F00);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.rocky-product-card-btn:hover {
    background: var(--warm-orange-dark, #E65100);
}

/* Inline Chat Trigger (replaces callback box) */
.rocky-inline-trigger {
    background: linear-gradient(135deg, rgba(255, 111, 0, 0.1), rgba(230, 81, 0, 0.05));
    border: 2px solid var(--warm-orange, #FF6F00);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rocky-inline-trigger:hover {
    background: linear-gradient(135deg, rgba(255, 111, 0, 0.15), rgba(230, 81, 0, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.2);
}

.rocky-inline-trigger-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid var(--warm-orange, #FF6F00);
}

.rocky-inline-trigger-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.rocky-inline-trigger h4 {
    font-size: 16px;
    color: var(--earth-dark, #2C1810);
    margin: 0 0 4px 0;
}

.rocky-inline-trigger p {
    font-size: 13px;
    color: var(--earth-brown, #5D4037);
    margin: 0 0 12px 0;
}

.rocky-inline-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--warm-orange, #FF6F00);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.rocky-inline-trigger-btn:hover {
    background: var(--warm-orange-dark, #E65100);
}

/* Move scroll arrows to mid-page */
.scroll-arrows {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto !important;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .rocky-chat-bubble {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    
    .rocky-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
    }
    
    .rocky-chat-hint {
        right: 20px;
        bottom: 90px;
    }
    
    .scroll-arrows {
        right: 15px;
    }
}
