/**
 * FCJ Live Chat Styles
 * Modern, responsive chat widget design
 */

/* Chat Button */
.fcj-chat-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 99999 !important;
    color: white;
    font-size: 24px;
    overflow: hidden;
}

.fcj-chat-button-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Online Status Indicator for Chat Button */
.fcj-chat-online-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2.5px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fcj-online-glow 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes fcj-online-glow {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.fcj-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}

.fcj-chat-button.fcj-chat-button-active {
    background: linear-gradient(135deg, #059669, #10b981);
}

.fcj-chat-button.fcj-chat-notification {
    animation: fcj-pulse 2s infinite;
}

@keyframes fcj-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Chat Badge */
.fcj-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #059669;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Widget */
.fcj-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fcj-chat-widget.fcj-chat-open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.fcj-chat-widget.fcj-chat-minimized {
    height: 60px;
}

/* Chat Header */
.fcj-chat-header {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fcj-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fcj-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Online Status Indicator for Chat Avatar */
.fcj-chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: fcj-avatar-pulse 3s infinite;
}

@keyframes fcj-avatar-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.fcj-chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.fcj-chat-header-text p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.fcj-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.fcj-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: fcj-blink 2s infinite;
}

@keyframes fcj-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fcj-status-text {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcj-chat-controls {
    display: flex;
    gap: 8px;
}

.fcj-chat-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcj-chat-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.fcj-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Welcome Form */
.fcj-chat-welcome {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.fcj-welcome-content {
    text-align: center;
    width: 100%;
}

.fcj-welcome-content h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.fcj-welcome-content p {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.fcj-form-group {
    margin-bottom: 16px;
}

.fcj-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.fcj-form-group input:focus {
    outline: none;
    border-color: #10b981;
}

.fcj-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.fcj-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.fcj-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Chat Messages */
.fcj-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: scroll;
    background: #f9fafb;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.fcj-chat-messages::-webkit-scrollbar {
    width: 0px !important;
    background: transparent !important;
    display: none !important;
}

.fcj-chat-messages::-webkit-scrollbar-track {
    display: none !important;
}

.fcj-chat-messages::-webkit-scrollbar-thumb {
    display: none !important;
}

.fcj-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.fcj-message-user {
    justify-content: flex-end;
}

.fcj-message-admin {
    justify-content: flex-start;
}

.fcj-message-system {
    justify-content: center;
}

.fcj-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fcj-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.fcj-message-user .fcj-message-content {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-bottom-right-radius: 4px;
}

.fcj-message-admin .fcj-message-content {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.fcj-message-system .fcj-message-content {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    text-align: center;
    font-size: 12px;
}

.fcj-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.fcj-message-time {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    margin-top: 4px;
}

/* Chat Input */
.fcj-chat-input-area {
    border-top: 1px solid #e5e7eb;
    background: white;
}

.fcj-chat-input-container {
    padding: 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.fcj-chat-input-container textarea {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.fcj-chat-input-container textarea:focus {
    outline: none;
    border-color: #10b981;
}

.fcj-chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fcj-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.fcj-chat-footer {
    padding: 8px 16px;
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.fcj-chat-footer small {
    color: #9ca3af;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fcj-chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
        left: 20px;
        bottom: 100px;
    }
    
    .fcj-chat-button {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .fcj-chat-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        left: 10px;
        bottom: 80px;
        border-radius: 12px;
    }
    
    .fcj-chat-button {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 20px;
    }
    
    .fcj-chat-button-avatar {
        width: 40px;
        height: 40px;
    }
    
    .fcj-welcome-content {
        padding: 16px;
    }
    
    .fcj-chat-messages {
        padding: 12px;
    }
    
    .fcj-chat-input-container {
        padding: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .fcj-chat-widget {
        background: #1f2937;
    }
    
    .fcj-chat-messages {
        background: #111827;
    }
    
    .fcj-welcome-content h3 {
        color: #f9fafb;
    }
    
    .fcj-welcome-content p {
        color: #d1d5db;
    }
    
    .fcj-form-group input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .fcj-form-group input:focus {
        border-color: #10b981;
    }
    
    .fcj-message-admin .fcj-message-content {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .fcj-chat-input-area {
        background: #1f2937;
        border-color: #4b5563;
    }
    
    .fcj-chat-input-container textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .fcj-chat-footer {
        background: #111827;
        border-color: #4b5563;
    }
}

/* Hide any existing chat buttons that might conflict */
.chat-widget:not(.fcj-chat-widget),
.chat-button:not(.fcj-chat-button),
#chat-widget:not(#fcj-chat-widget),
#chat-button:not(#fcj-chat-button) {
    display: none !important;
}

/* Featured badge removal moved to main style.css file */

/* Enhanced Accessibility Panel Styles */
.fcj-accessibility-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.fcj-accessibility-panel.fcj-accessibility-open {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.fcj-accessibility-header {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fcj-accessibility-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fcj-accessibility-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcj-accessibility-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fcj-accessibility-content {
    padding: 16px;
    max-height: calc(80vh - 64px);
    overflow-y: auto;
}

.fcj-accessibility-group {
    margin-bottom: 20px;
}

.fcj-accessibility-group:last-child {
    margin-bottom: 0;
}

.fcj-accessibility-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

.fcj-accessibility-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fcj-accessibility-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.fcj-accessibility-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.fcj-accessibility-btn[aria-pressed="true"] {
    background: #10b981;
    border-color: #059669;
    color: white;
}

.fcj-accessibility-btn i {
    font-size: 11px;
}

/* Accessibility Feature Styles */
.fcj-high-contrast {
    filter: contrast(150%) brightness(110%);
}

.fcj-high-contrast * {
    text-shadow: none !important;
    box-shadow: none !important;
}

.fcj-focus-highlight *:focus {
    outline: 3px solid #fbbf24 !important;
    outline-offset: 2px !important;
}

.fcj-reduce-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.fcj-stop-animations * {
    animation: none !important;
    transition: none !important;
}

.fcj-reading-guide-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    background: #fbbf24;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fcj-accessibility-panel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        top: 20px;
    }
    
    .fcj-accessibility-controls {
        flex-direction: column;
    }
    
    .fcj-accessibility-btn {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .fcj-accessibility-panel {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        top: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .fcj-accessibility-content {
        max-height: calc(100vh - 84px);
    }
}

/* Dark Mode Support for Accessibility Panel */
@media (prefers-color-scheme: dark) {
    .fcj-accessibility-panel {
        background: #1f2937;
        border-color: #4b5563;
    }
    
    .fcj-accessibility-group h4 {
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .fcj-accessibility-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .fcj-accessibility-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
}

/* Scrollbar Hidden - Clean appearance */
