/* MAYA Integration Styles - Professional interface for AI mentoring */

/* MAYA Toolbar */
.maya-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Professional purple gradient */
    color: #FFFFFF; /* White text for better contrast */
    padding: 16px 20px; /* Increased padding */
    border-radius: 8px 8px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600; /* Bolder text for better readability */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0;
    min-width: 350px; /* Ensure adequate width */
}

.maya-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.maya-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.maya-icon {
    font-size: 18px;
}

.maya-name {
    font-weight: 600;
    font-size: 16px;
}

.maya-status {
    background: rgba(255, 255, 255, 0.2); /* Light background */
    color: #FFFFFF; /* White text */
    padding: 4px 12px; /* More padding */
    border-radius: 12px;
    font-size: 12px; /* Slightly larger font */
    font-weight: 600; /* Bolder text */
}

.maya-toolbar-center {
    display: flex;
    gap: 8px;
}

.maya-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.maya-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.maya-btn:active {
    transform: translateY(0);
}

.maya-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

.btn-icon {
    font-size: 14px;
}

.maya-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Confidence Display */
.maya-confidence-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.confidence-label {
    font-weight: 500;
}

.confidence-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 3px;
}

.confidence-fill.confidence-high {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.confidence-fill.confidence-medium {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.confidence-fill.confidence-low {
    background: linear-gradient(90deg, #dc3545 0%, #e83e8c 100%);
}

.confidence-value {
    font-weight: 600;
    min-width: 30px;
}

/* Status Indicator */
.maya-status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* MAYA Modals */
.maya-modal {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.maya-generate-dialog .modal-body {
    padding: 24px;
}

.generation-input-section {
    margin-bottom: 24px;
}

.generation-input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.generation-input-section textarea {
    width: 100%;
    height: 120px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.generation-input-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.generation-options h4 {
    margin: 0 0 16px 0;
    color: #343a40;
    font-size: 16px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #212529;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.context-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-row label {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-row select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Results Modal */
.maya-results-modal {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
}

.results-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.score-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.score-item {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.score-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

.maya-score {
    color: #667eea;
}

.aria-score {
    color: #28a745;
}

.alignment-score {
    color: #ffc107;
}

/* Tabs */
.results-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #495057;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Notifications */
.maya-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.maya-notification-success {
    background: #d1edcc;
    color: #155724;
    border-left: 4px solid #28a745;
}

.maya-notification-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.maya-notification-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.maya-notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Base Styles (if not already defined) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.btn-primary:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

.btn-secondary {
    background: white;
    color: #6c757d;
    border: 1px solid #ced4da;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .maya-toolbar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .maya-toolbar-center {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .maya-toolbar-right {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .maya-confidence-display {
        flex: 1;
    }

    .confidence-bar {
        width: 120px;
    }

    .context-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .score-display {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .results-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .results-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .maya-toolbar {
        background: linear-gradient(135deg, #4c63d2 0%, #5a4a82 100%);
    }

    .modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }

    .modal-header {
        background: linear-gradient(135deg, #4c63d2 0%, #5a4a82 100%);
    }

    .modal-body {
        background: #2d3748;
    }

    .modal-footer {
        background: #4a5568;
        border-color: #718096;
    }

    .generation-input-section textarea {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }

    .context-options {
        background: #4a5568;
    }

    .results-summary {
        background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    }

    .score-item {
        background: #2d3748;
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .maya-toolbar,
    .maya-status-indicator,
    .modal-overlay {
        display: none !important;
    }
}