/* Enhanced AI Content Search Frontend Styles with Chat Bot */

/* Search Mode Toggle */
.acs-search-mode-toggle {
    margin-bottom: -1px;
}

.acs-toggle-wrapper {
    display: flex;
    background: #fff;
    border: 1px solid #000;
    border-radius: 0px;
    padding: 0px;
    gap:0px;
}

.acs-mode-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0px;
    margin-bottom: 0px;		
}
.dark .acs-mode-button {
    background: #222;
}
.acs-mode-button:hover {
    background: #444;
    color: #fff;
}

.acs-mode-button.active {
    background: #000;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.acs-mode-icon {
    flex-shrink: 0;
}

/* Dark mode support for toggle */
.dark .acs-toggle-wrapper {
    background: #555;
    border-color: #444;
}
.dark li::marker,
.dark .acs-mode-button {
    color: #ccc;
}

.dark .acs-mode-button:hover {
    background: #333;
    color: #fff;
}

.dark .acs-mode-button.active {
    background: #000;
    color: #fff;
}

/* Chat Interface Styles */
.acs-chat-interface {
    border: 1px solid #000;
    border-radius: 0px;
    overflow: hidden;
}

.dark .acs-chat-interface {
    border-color: #444;
}

/* Chat Header */
.acs-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.dark .acs-chat-header {
    background: #2a2a2a;
    border-bottom-color: #444;
}

.acs-chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}
.acs-input-wrapper .acs-status-indicator {
margin-left:10px;
}
.acs-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.acs-status-indicator.offline {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.acs-status-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.dark .acs-status-text {
    color: #ccc;
}

.acs-chat-clear {
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.acs-chat-clear:hover {
    background: #e9ecef;
    color: #333;
}

.dark .acs-chat-clear {
    color: #999;
}

.dark .acs-chat-clear:hover {
    background: #333;
    color: #fff;
}

/* Chat Messages */
.acs-chat-messages {
    overflow-y: auto;
    padding: 20px;
    background: white;
    scroll-behavior: smooth;
}

.dark .acs-chat-messages {
    background: #222;
}

.acs-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

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

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

.acs-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.acs-user-message .acs-message-avatar {
    background: #667eea;
}

.acs-message-content {
    flex: 1;
    max-width: 90%;
}

.acs-user-message .acs-message-content {
    text-align: right;
}

.acs-message-text {
    background: #f8f9fa;
    padding: 12px 16px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
}

.acs-user-message .acs-message-text {
    background: #667eea;
    color: white;
}

.dark .acs-message-text {
    background: #444;
    color: #ccc;
}

.dark .acs-user-message .acs-message-text {
    background: #444;
}

.acs-message-time {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    padding: 0;
}

.acs-user-message .acs-message-time {
    text-align: right;
}

/* Typing Indicator */
.acs-typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

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

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

.acs-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.acs-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;
    }
}

/* Chat Input */
.acs-chat-input-wrapper {
	padding:0 20px;
}
.dark .acs-search-help,
.dark .acs-chat-input-wrapper {
    background: #222;
}

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

.acs-chat-input {
    flex: 1;
    border: 1px solid #000;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    background: white;
    color: #333;
	margin-bottom:0;
    transition: border-color 0.2s ease;
}

.acs-chat-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0);
}

.dark .acs-chat-input {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

.dark .acs-chat-input:focus {
    border-color: #667eea;
}

.acs-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
	margin-bottom:0;
}

.acs-chat-send:hover:not(:disabled) {
    background: #5a6fd8;
    transform: scale(1.05);
}

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

.acs-chat-send:active:not(:disabled) {
    transform: scale(0.95);
}

/* Chat Suggestions */
.acs-chat-suggestions {
    display: flex;
    gap: 0px 8px;
    padding: 0 0 16px 0;
    flex-wrap: wrap;
}
.acs-chat-notify {
	width:100%;
	float:left;
	margin-bottom:5px;
}
.acs-suggestion-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
}

.acs-suggestion-chip:hover {
    background: #000;
    color: white;
    border-color: #000;
}

.dark .acs-suggestion-chip {
    background: #222;
    border-color: #444;
    color: #999;
}

.dark .acs-suggestion-chip:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Chat Results Integration */
.acs-chat-results {
	width:100%;
	float:left;	
    padding: 0 0 5px 0;
}

.acs-chat-results-header {
    font-weight: 600;
    padding: 12px 16px;	
    margin-bottom: 15px;
}

.dark .acs-chat-results-header {
    background: #444;	
}

.acs-result-fullitem {
    display: flex;
    gap: 20px;
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.5s ease forwards;
}
.acs-chat-result-thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 90px;
    overflow: hidden;
} 
.acs-chat-result-thumbnail img{
	width: 100%;
    height: 100%;
    object-fit: cover;
} 
.acs-result-content {
    flex: 1;
    min-width: 0;
}
.acs-chat-result-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.acs-chat-result-meta {
    display: flex;
    align-items: flex-start;
    justify-content: start;
    margin-top: 15px;
    gap: 5px;
} 
.acs-chat-result-post-type {
	position:absolute;
	text-transform:capitalize;
	border:1px solid#000;
    padding: 6px 15px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
	bottom:-1px;
	right:-1px;
    transition: all 0.2s ease;	
}
.dark .acs-chat-result-post-type {
	border:1px solid#444;
}
.acs-chat-result-item {
	position:relative;	
    display: block;
    padding: 12px;
    border: 1px solid #222;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.acs-chat-result-item:hover {
    border: 1px solid #444;
}

.acs-chat-result-item:hover .acs-chat-result-post-type {
    background: #444;
    color: #fff;
}
.dark .acs-chat-result-item {
    background: #222;
    border-color: #444;
}

.acs-chat-result-title {
	margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.dark .acs-chat-result-title {
    color: #ccc;
}

.acs-chat-result-excerpt {
    font-size: 13px;
    line-height: 1.4;
	margin-bottom:10px;
}

.dark .acs-chat-result-excerpt {
    color: #999;
}
.acs-chat-result-reading-time,
.acs-chat-result-categories,
.acs-chat-result-date{
    font-size: 12px;
    line-height: 1.4;
}
/* Responsive Design for Chat */
@media (max-width: 768px) {
    .acs-toggle-wrapper {
        flex-direction: column;
        gap: 2px;
    }
    
    .acs-mode-button {
        padding: 14px 16px;
    }
    
    .acs-chat-messages {
        height: 300px;
        padding: 16px;
    }
    
    .acs-message-content {
        max-width: 85%;
    }
    
    .acs-chat-input-container {
        padding: 12px 16px;
    }
    
    .acs-chat-suggestions {
        padding: 0 16px 12px;
    }
    
    .acs-suggestion-chip {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .acs-chat-messages {
        height: 250px;
        padding: 12px;
    }
    
    .acs-message-content {
        max-width: 90%;
    }
    
    .acs-chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .acs-chat-suggestions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .acs-suggestion-chip {
        text-align: center;
        white-space: normal;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .acs-chat-message,
    .acs-typing-indicator,
    .acs-status-indicator {
        animation: none;
    }
    
    .acs-chat-send:hover:not(:disabled) {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .acs-toggle-wrapper {
        border: 2px solid #000;
    }
    
    .acs-mode-button.active {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .acs-chat-interface {
        border: 2px solid #000;
    }
    
    .acs-message-text {
        border: 1px solid #000;
    }
    
    .acs-chat-input {
        border: 2px solid #000;
    }
    
    .acs-chat-send {
        border: 2px solid #000;
    }
}

/* Focus Styles for Accessibility */
.acs-mode-button:focus,
.acs-chat-clear:focus,
.acs-chat-send:focus,
.acs-suggestion-chip:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.acs-chat-input:focus {
    outline: none; /* Custom focus style already applied */
}

/* Scrollbar Styling for Chat Messages */
.acs-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.acs-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.acs-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.acs-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dark .acs-chat-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.dark .acs-chat-messages::-webkit-scrollbar-thumb {
    background: #555;
}

.dark .acs-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #777;
}

