/* VTT Search Styles */

.vtt-search-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vtt-search-form {
    display: flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

#vtt-search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#vtt-search-button {
    padding: 10px 20px;
    background-color: #e6ac00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#vtt-search-button:hover {
    background-color: #e3ac00;
}

.vtt-search-filters {
    margin: 15px 0;
    text-align: center;
}

.vtt-filter-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 16px;
    margin: 0 5px 5px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.vtt-filter-btn:hover {
    background: #e0e0e0;
}

.vtt-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.vtt-loading {
    padding: 20px;
    text-align: center;
    font-style: italic;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

.vtt-error {
    padding: 15px;
    background-color: #ffeeee;
    border-left: 3px solid #cc0000;
    margin: 10px 0;
    color: #333;
}

.vtt-no-results {
    padding: 15px;
    text-align: center;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 4px;
    color: #666;
}

.vtt-results-count {
    margin-bottom: 20px;
    font-weight: bold;
    color: #333;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.vtt-post-result {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vtt-title-match {
    background-color: rgba(255, 255, 0, 0.1);
    border-left: 3px solid #ffcc00;
}

.vtt-post-header {
    display: flex;
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.vtt-post-thumbnail {
    width: 85px;
    height: 85px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
    flex-shrink: 0;
}

.vtt-post-info {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.vtt-post-info h3 {
    margin: 0 10px 0 0;
    font-size: 16px;
}

.vtt-post-info h3 a {
    color: #0073aa;
    text-decoration: none;
}

.vtt-post-info h3 a:hover {
    text-decoration: underline;
}

.vtt-post-type {
    display: inline-block;
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 10px;
    color: #333;
}

.vtt-categories {
    display: inline-block;
    background: #e8f4e5;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 10px;
    color: #333;
}

.vtt-match-type {
    background-color: #ffcc00;
    color: #333;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: bold;
}

.vtt-matches {
    padding: 15px;
}

.vtt-result-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.vtt-result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.vtt-timestamp {
    display: inline-block;
    min-width: 60px;
    padding: 3px 8px;
    background: #00aa96;
    color: white;
    text-align: center;
    border-radius: 3px;
    margin-right: 10px;
    font-weight: bold;
    text-decoration: none;
    font-size: 12px;
}

.vtt-timestamp:hover {
    background: #00aa96;
    color: white;
}

.vtt-text {
    margin: 5px 0 0 0;
    line-height: 1.4;
}

.vtt-text .vtt-highlight {
    background-color: #ffff99;
    padding: 0 2px;
}

.vtt-more-results {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    text-align: right;
}

.vtt-caption-section {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.vtt-debug-info {
    margin-bottom: 10px;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    font-size: 12px;
    font-family: monospace;
	display:none
}

.vtt-timestamp.vtt-course {
    background-color: #6b9b37; /* Green for courses */
}

.vtt-course-result {
    background-color: rgba(107, 155, 55, 0.05); /* Light green background for course results */
    border-left: 3px solid #6b9b37;
}

.vtt-post-type.vtt-course-type {
    background-color: #6b9b37; /* Green for courses */
    color: white;
    font-weight: bold;
}

.vtt-timestamp.vtt-course {
    background-color: #6b9b37; /* Green for courses */
}

.vtt-timestamp.vtt-lesson {
    background-color: #2271b1; /* WordPress blue for lessons */
}

/* ============================================
   AI ASSISTANT STYLES
   ============================================ */

/* Mode Toggle */
.vtt-mode-controls {
    margin-bottom: 20px;
    text-align: right;
}

.vtt-mode-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vtt-mode-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.vtt-ai-icon,
.vtt-search-icon {
    font-size: 18px;
}

/* AI Container */
.vtt-ai-container {
    margin-top: 20px;
}

.vtt-ai-chat-box {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* AI Header */
.vtt-ai-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vtt-ai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vtt-ai-status {
    font-size: 12px;
    animation: pulse 2s infinite;
}

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

.vtt-ai-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vtt-ai-clear-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.vtt-ai-clear-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Messages Area */
.vtt-ai-messages {
    height: 450px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f9f9f9 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.vtt-ai-messages::-webkit-scrollbar {
    width: 8px;
}

.vtt-ai-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.vtt-ai-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.vtt-ai-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Messages */
.vtt-ai-message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
    max-width: 85%;
}

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

.vtt-ai-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.vtt-ai-user {
    margin-left: auto;
}

.vtt-ai-user .vtt-ai-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.vtt-ai-message:not(.vtt-ai-user) .vtt-ai-message-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.vtt-ai-error .vtt-ai-message-content {
    background: #fee;
    border-color: #fcc;
    color: #c00;
}

.vtt-ai-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

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

/* Welcome Message */
.vtt-ai-welcome {
    text-align: center;
    padding: 40px 20px;
}

.vtt-ai-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.vtt-ai-welcome h4 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: #333;
}

.vtt-ai-welcome p {
    color: #666;
    margin: 0 0 24px 0;
}

.vtt-ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.vtt-suggestions-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    margin-bottom: 4px;
}

.vtt-ai-suggestion-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: #667eea;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: left;
}

.vtt-ai-suggestion-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(4px);
}

/* Loading */
.vtt-ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-style: italic;
}

.vtt-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI Answer */
.vtt-ai-answer-text {
    line-height: 1.7;
    margin-bottom: 16px;
}

.vtt-ai-answer-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid #667eea;
}

.vtt-ai-answer-text a:hover {
    border-bottom: 2px solid #667eea;
}

/* Lesson Cards */
.vtt-ai-lessons-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.vtt-ai-lesson-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: linear-gradient(to right, #f8f9ff 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    position: relative;
}

.vtt-ai-lesson-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateX(4px);
}

.vtt-ai-lesson-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.vtt-ai-lesson-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.vtt-ai-lesson-title {
    font-weight: 600;
    color: #333;
    flex: 1;
    line-height: 1.4;
}

.vtt-ai-lesson-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.vtt-time-icon {
    font-size: 14px;
}

.vtt-ai-lesson-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 20px;
    opacity: 0;
    transition: all 0.2s;
}

.vtt-ai-lesson-card:hover .vtt-ai-lesson-arrow {
    opacity: 1;
    right: 10px;
}

/* Input Area */
.vtt-ai-input-wrapper {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 2px solid #e0e0e0;
    gap: 12px;
    align-items: flex-end;
}

.vtt-ai-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s;
}

.vtt-ai-input:focus {
    outline: none;
    border-color: #667eea;
}

.vtt-ai-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.vtt-ai-send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vtt-ai-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.vtt-ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vtt-send-icon {
    font-size: 18px;
}

/* Footer */
.vtt-ai-footer {
    padding: 12px 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.vtt-ai-footer small {
    color: #888;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .vtt-ai-messages {
        height: 350px;
    }
    
    .vtt-ai-message {
        max-width: 90%;
    }
    
    .vtt-mode-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .vtt-search-form {
        flex-direction: column;
    }
    
    #vtt-search-input {
        width: 100%;
    }
    
    .vtt-result-item {
        flex-direction: column;
    }
    
    .vtt-timestamp {
        margin-bottom: 10px;
        margin-right: 0;
    }
}