/* Vidya AI Chatbot Styles */

/* Reset and Base Styles */
.vidya-chatbot-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.vidya-chatbot-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 600px;
}

/* Header Styles */
.vidya-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.vidya-logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.vidya-logo {
    margin-right: 12px;
}

.vidya-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vidya-search-container {
    max-width: 600px;
    margin: 0 auto;
}

.vidya-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.vidya-search-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.vidya-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 24px;
    font-size: 16px;
    background: transparent;
    color: #333;
}

.vidya-search-input::placeholder {
    color: #888;
}

.vidya-mic-btn,
.vidya-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.vidya-mic-btn:hover,
.vidya-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.vidya-mic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.vidya-disclaimer {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 16px;
    font-style: italic;
}

/* Main Content Area */
.vidya-main-content {
    min-height: 400px;
    position: relative;
}

/* Tools Section */
.vidya-tools-section {
    padding: 32px;
    background: rgba(255, 255, 255, 0.95);
}

.vidya-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.vidya-tool-category {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.vidya-tool-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.tool-category-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.tool-icon {
    font-size: 24px;
    margin-right: 12px;
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.tool-card {
    background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.tool-card-icon {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tool-card p {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Chat Section */
.vidya-chat-section {
    background: rgba(255, 255, 255, 0.95);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vidya-chat-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
}

.vidya-back-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    margin-right: 16px;
}

.vidya-back-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.vidya-chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.vidya-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
    max-height: 400px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 80%;
    min-width: 60px;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.ai {
    align-self: flex-start;
}

.message-content {
    background: #667eea;
    color: white;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.ai .message-content {
    background: white;
    color: #333;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-timestamp {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    padding: 0 8px;
}

.chat-message.user .message-timestamp {
    text-align: right;
}

/* Chat Input */

.vidya-chat-area-container {
    width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.vidya-chat-area {
    width: 1000px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(80,80,120,0.07);
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.vidya-chat-messages-scroll {
    width: 1000px;
    max-width: 1000px;
    margin: 0 auto;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 16px 0 16px;
    background: transparent;
}

.vidya-chat-inputbar {
    width: 1000px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
    background: transparent;
    display: flex;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.vidya-chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    background: transparent;
    font-size: 15px;
    color: #333;
}

.vidya-chat-input::placeholder {
    color: #888;
}

.vidya-chat-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vidya-chat-send-btn:hover {
    transform: scale(1.05);
}

.vidya-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Modal Styles */
.vidya-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vidya-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    height: 800px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.vidya-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.vidya-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.vidya-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.vidya-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.vidya-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Loading Spinner */
.vidya-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.vidya-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Message References */
.message-references {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.reference-section {
    margin-bottom: 16px;
}

.reference-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.reference-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.reference-image {
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.reference-image:hover {
    transform: scale(1.05);
}

.reference-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reference-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.reference-video {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.reference-video:hover {
    transform: scale(1.02);
}

.reference-video img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.reference-video .video-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: white;
}

.related-questions {
    margin-top: 16px;
}

.related-questions-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.related-question {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    padding: 6px 12px;
    margin: 4px 4px 4px 0;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.related-question:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vidya-chatbot-wrapper {
        border-radius: 0;
        height: 100vh;
    }
    
    .vidya-header {
        padding: 16px;
    }
    
    .vidya-title {
        font-size: 24px;
    }
    
    .vidya-tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }
    
    .tool-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .vidya-tools-section {
        padding: 20px 16px;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .vidya-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .vidya-search-wrapper {
        padding: 2px;
    }
    
    .vidya-search-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .vidya-mic-btn,
    .vidya-send-btn {
        width: 40px;
        height: 40px;
    }
    
    .tool-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .tool-card {
        padding: 16px;
    }
    
    .tool-card h4 {
        font-size: 14px;
    }
    
    .tool-card p {
        font-size: 12px;
    }
}