/* REAPR Live Chat Widget - φ-styled */

#reapr-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'JetBrains Mono', monospace;
}

.reapr-chat-toggle {
    background: linear-gradient(135deg, #00f0ff, #ffd700);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.4);
    animation: glow 2s infinite;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.reapr-chat-toggle:hover {
    transform: scale(1.05);
}

.reapr-icon {
    font-size: 20px;
}

.reapr-chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00f0ff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 240, 255, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    backdrop-filter: blur(20px);
}

.reapr-chat-closed .reapr-chat-box {
    display: none;
}

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

.reapr-chat-header {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(123, 47, 247, 0.2));
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reapr-header-content {
    display: flex;
    flex-direction: column;
}

.reapr-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 900;
    color: #00f0ff;
    text-shadow: 0 0 10px #00f0ff;
}

.reapr-subtitle {
    font-size: 11px;
    color: #8892b0;
    margin-top: 3px;
}

.reapr-close {
    background: none;
    border: none;
    color: #8892b0;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: color 0.2s;
}

.reapr-close:hover {
    color: #00f0ff;
}

.reapr-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reapr-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.reapr-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.reapr-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 3px;
}

.reapr-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

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

.reapr-message.reapr-user {
    flex-direction: row-reverse;
}

.reapr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #7b2ff7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.reapr-message .reapr-text {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 15px;
    padding: 12px 16px;
    max-width: 75%;
    color: #e0e6ff;
    font-size: 14px;
    line-height: 1.6;
}

.reapr-message.reapr-user .reapr-text {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.2);
    text-align: right;
}

.reapr-message.typing .reapr-text {
    font-style: italic;
    color: #8892b0;
}

.reapr-message strong {
    color: #00f0ff;
    font-weight: 700;
}

.reapr-chat-input-area {
    border-top: 1px solid rgba(0, 240, 255, 0.2);
    padding: 15px;
}

.reapr-limit-display {
    font-size: 11px;
    color: #8892b0;
    text-align: center;
    margin-bottom: 10px;
}

.reapr-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#reapr-input {
    flex: 1;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    padding: 12px 15px;
    color: #e0e6ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 44px;
}

#reapr-input:focus {
    outline: none;
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

#reapr-input::placeholder {
    color: #666;
}

.reapr-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #00f0ff, #ffd700);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #000;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reapr-send-btn:hover {
    transform: scale(1.1);
}

.reapr-send-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .reapr-chat-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 80px;
    }
    
    .reapr-chat-toggle {
        padding: 12px 24px;
        font-size: 14px;
    }
}
