/**
 * RetroVerse Studio AI Co-Author Styles
 * Uses CSS variables from bootstrap-theme.css for consistent theming
 */

/* Panel Container */
.coauthor-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 450px;
    height: 100vh;
    background: var(--bs-white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.coauthor-panel.hidden {
    transform: translateX(100%);
}

.coauthor-panel.visible {
    transform: translateX(0);
}

/* Header */
.coauthor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bs-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coauthor-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.coauthor-header h3 i {
    margin-right: 0.5rem;
}

.coauthor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--bs-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.coauthor-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Status Indicator */
.coauthor-status {
    padding: 0.75rem 1.5rem;
    background: var(--bs-gray-100);
    border-bottom: 1px solid var(--bs-gray-200);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bs-gray-600);
    animation: pulse 2s infinite;
}

.status-dot.status-ready {
    background: var(--bs-success);
}

.status-dot.status-partial {
    background: var(--bs-warning);
}

.status-dot.status-error {
    background: var(--bs-danger);
}

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

/* Content Area */
.coauthor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.coauthor-section {
    margin-bottom: 1.5rem;
}

.coauthor-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-gray-700);
    font-size: 0.875rem;
}

.coauthor-section .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-gray-400);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.coauthor-section .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.coauthor-section textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.coauthor-section small.form-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--bs-gray-600);
    font-size: 0.75rem;
}

.coauthor-section small.template-description,
.coauthor-section small.model-description {
    font-style: italic;
}

/* Checkbox */
.form-check {
    padding-left: 1.5rem;
}

.form-check-input {
    margin-left: -1.5rem;
    margin-top: 0.3rem;
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bs-white);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    background: var(--bs-success);
    color: var(--bs-white);
}

.btn-success:hover {
    background: #218838;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Results */
.coauthor-results {
    margin-top: 1.5rem;
}

.coauthor-result-card {
    background: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--bs-gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-notes {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-left: 4px solid var(--bs-warning);
    border-radius: var(--border-radius-sm);
}

.result-notes strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #856404;
}

.result-notes ul {
    margin: 0;
    padding-left: 1.5rem;
}

.result-notes li {
    font-size: 0.875rem;
    color: #856404;
    margin-bottom: 0.25rem;
}

.result-entity {
    margin-top: 1rem;
}

.result-entity pre {
    background: #272822;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0;
}

.result-content pre {
    background: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-validation {
    margin-top: 1rem;
}

.result-images {
    margin-top: 1rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.alert li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
}

.alert-dismissible .close:hover {
    opacity: 1;
}

/* Toggle Button (when minimized) */
.coauthor-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bs-white);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s;
}

.coauthor-panel.hidden .coauthor-toggle {
    display: flex;
}

.coauthor-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* Scrollbar Styling */
.coauthor-content::-webkit-scrollbar {
    width: 8px;
}

.coauthor-content::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
}

.coauthor-content::-webkit-scrollbar-thumb {
    background: var(--bs-gray-500);
    border-radius: 4px;
}

.coauthor-content::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    .coauthor-panel {
        width: 100%;
    }

    .coauthor-toggle {
        bottom: 80px;
    }
}

/* Utility Classes */
.mt-2 {
    margin-top: 0.5rem;
}

.text-success {
    color: var(--bs-success);
}

.text-muted {
    color: var(--bs-gray-600);
}

.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}

.show {
    opacity: 1;
}
