/**
 * Frontend styles for Henotace AI Tutor
 *
 * @package Henotace_AI_Tutor
 * @since 1.0.0
 */

/* AI Tutor Chat Widget Styles */
.henotace-ai-tutor-widget {
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 350px;
    height: 450px;
    position: relative;
}

.henotace-ai-tutor-header {
    background: #2d2d2d;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333333;
    flex-shrink: 0;
}

.henotace-ai-tutor-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.henotace-ai-tutor-header h3::before {
    content: '🤖';
    font-size: 16px;
}

.henotace-ai-tutor-status {
    font-size: 11px;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.henotace-ai-tutor-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.henotace-ai-tutor-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #1a1a1a;
    min-height: 0;
}

.henotace-ai-tutor-message {
    display: flex;
    margin-bottom: 12px;
    gap: 8px;
}

.henotace-ai-tutor-bot-message {
    align-items: flex-start;
}

.henotace-ai-tutor-user-message {
    align-items: flex-end;
    flex-direction: row-reverse;
}

.henotace-ai-tutor-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.henotace-ai-tutor-bot-message .henotace-ai-tutor-avatar {
    background: #4a5568;
    color: #ffffff;
}

.henotace-ai-tutor-user-message .henotace-ai-tutor-avatar {
    background: #3b82f6;
    color: white;
}

.henotace-ai-tutor-content {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 13px;
}

.henotace-ai-tutor-bot-message .henotace-ai-tutor-content {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 3px;
}

.henotace-ai-tutor-user-message .henotace-ai-tutor-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 3px;
}

.henotace-ai-tutor-input-container {
    padding: 12px 16px;
    background: #2d2d2d;
    border-top: 1px solid #333333;
    flex-shrink: 0;
}

.henotace-ai-tutor-input-wrapper {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #444444;
    border-radius: 20px;
    padding: 3px;
    transition: all 0.2s ease;
}

.henotace-ai-tutor-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.henotace-ai-tutor-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    color: #ffffff;
}

.henotace-ai-tutor-input-wrapper input::placeholder {
    color: #a0a0a0;
}

.henotace-ai-tutor-send-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.henotace-ai-tutor-send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.henotace-ai-tutor-send-btn:active {
    transform: scale(0.95);
}

.henotace-ai-tutor-send-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* Tutor Widget Styles (Legacy) */
.henotace-tutor-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.henotace-tutor-widget[data-position="left"] {
    left: 20px;
    right: auto;
}

.henotace-tutor-widget[data-position="top"] {
    top: 20px;
    bottom: auto;
}

.henotace-tutor-widget[data-style="inline"] {
    position: static;
    margin: 20px 0;
    width: 100%;
    max-width: 600px;
}

.henotace-tutor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
}

.henotace-tutor-header h3,
.henotace-tutor-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.henotace-tutor-toggle {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.henotace-tutor-toggle:hover {
    background: #005a87;
}

.henotace-tutor-toggle.active {
    background: #dc3232;
}

.henotace-tutor-icon {
    font-size: 18px;
}

.henotace-tutor-content {
    display: none;
    flex-direction: column;
    height: 400px;
}

.henotace-tutor-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 300px;
}

.henotace-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.henotace-message-user {
    align-items: flex-end;
}

.henotace-message-ai {
    align-items: flex-start;
}

.henotace-message-error {
    align-items: flex-start;
}

.henotace-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.henotace-message-user .henotace-message-content {
    background: #007cba;
    color: white;
    border-bottom-right-radius: 4px;
}

.henotace-message-ai .henotace-message-content {
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 4px;
}

.henotace-message-error .henotace-message-content {
    background: #ffe6e6;
    color: #d63384;
    border: 1px solid #f5c6cb;
}

.henotace-message-time {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    padding: 0 5px;
}

.henotace-tutor-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.henotace-tutor-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.henotace-tutor-input input:focus {
    border-color: #007cba;
}

.henotace-tutor-send {
    margin-left: 10px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.henotace-tutor-send:hover {
    background: #005a87;
}

.henotace-tutor-typing {
    padding: 10px 15px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Tutor Chat Styles */
.henotace-tutor-chat {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.henotace-chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.henotace-chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.henotace-chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.henotace-chat-send {
    margin-left: 10px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.henotace-chat-typing {
    padding: 10px 15px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

/* Course Analysis Styles */
.henotace-course-analysis {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.henotace-analysis-section {
    margin-bottom: 20px;
}

.henotace-analysis-section:last-child {
    margin-bottom: 0;
}

.henotace-analysis-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.henotace-concepts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.henotace-concept-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.henotace-difficulty-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.henotace-difficulty-badge.difficulty-beginner {
    background: #e8f5e8;
    color: #2e7d32;
}

.henotace-difficulty-badge.difficulty-intermediate {
    background: #fff3e0;
    color: #f57c00;
}

.henotace-difficulty-badge.difficulty-advanced {
    background: #ffebee;
    color: #c62828;
}

/* Learning Path Styles */
.henotace-learning-path {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.henotace-learning-path h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.henotace-progress-bar {
    position: relative;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.henotace-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.henotace-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.henotace-path-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.henotace-path-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.henotace-path-step.completed {
    background: #e8f5e8;
    border-color: #4caf50;
}

.henotace-path-step.current {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.henotace-step-number {
    width: 30px;
    height: 30px;
    background: #ddd;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.henotace-path-step.completed .henotace-step-number {
    background: #4caf50;
    color: white;
}

.henotace-path-step.current .henotace-step-number {
    background: #2196f3;
    color: white;
}

.henotace-step-content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.henotace-step-content p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.henotace-step-time {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Quiz Helper Styles */
.henotace-quiz-helper {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.henotace-quiz-helper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.henotace-quiz-helper-header h4 {
    margin: 0;
    color: #333;
}

.henotace-quiz-helper-toggle {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.henotace-quiz-helper-content {
    padding: 15px;
}

.henotace-quiz-hints,
.henotace-quiz-explanations {
    margin-bottom: 15px;
}

.henotace-quiz-hints h5,
.henotace-quiz-explanations h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.henotace-quiz-ask {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.henotace-quiz-ask input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.henotace-quiz-ask button {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* Study Guide Styles */
.henotace-study-guide {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.henotace-study-guide h3 {
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.henotace-study-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.henotace-study-tab {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.henotace-study-tab:last-child {
    border-right: none;
}

.henotace-study-tab.active {
    background: #fff;
    color: #007cba;
    border-bottom: 2px solid #007cba;
}

.henotace-study-content {
    position: relative;
}

.henotace-study-panel {
    display: none;
    padding: 20px;
    min-height: 200px;
}

.henotace-study-panel.active {
    display: block;
}

.henotace-study-panel.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

/* Flashcard Styles */
.henotace-flashcard {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    perspective: 1000px;
}

.henotace-flashcard:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.henotace-flashcard.flipped {
    transform: rotateY(180deg);
}

.henotace-flashcard-front,
.henotace-flashcard-back {
    backface-visibility: hidden;
    transition: transform 0.3s ease;
}

.henotace-flashcard-back {
    transform: rotateY(180deg);
}

.henotace-flashcard.flipped .henotace-flashcard-front {
    transform: rotateY(-180deg);
}

.henotace-flashcard.flipped .henotace-flashcard-back {
    transform: rotateY(0deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .henotace-tutor-widget {
        width: 100%;
        max-width: calc(100vw - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .henotace-tutor-widget[data-position="left"] {
        left: 10px;
        right: 10px;
    }
    
    .henotace-tutor-widget[data-position="top"] {
        top: 10px;
        bottom: auto;
    }
    
    .henotace-path-steps {
        gap: 10px;
    }
    
    .henotace-path-step {
        flex-direction: column;
        text-align: center;
    }
    
    .henotace-step-number {
        align-self: center;
    }
    
    .henotace-study-tabs {
        flex-direction: column;
    }
    
    .henotace-study-tab {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .henotace-study-tab:last-child {
        border-bottom: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .henotace-tutor-widget,
    .henotace-tutor-chat,
    .henotace-course-analysis,
    .henotace-learning-path,
    .henotace-quiz-helper,
    .henotace-study-guide {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .henotace-tutor-header,
    .henotace-quiz-helper-header,
    .henotace-study-guide h3 {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .henotace-tutor-input,
    .henotace-chat-input,
    .henotace-chat-typing {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .henotace-tutor-input input,
    .henotace-chat-input input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .henotace-message-ai .henotace-message-content {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .henotace-concept-tag {
        background: #2b6cb0;
        color: #e2e8f0;
    }
}
