/* ====================================
   Profile Page Styles
   ==================================== */

/* Profile Styles */
.profile-section {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.profile-card {
    background: var(--background);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-field {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.profile-field span, .profile-field a {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
}

.profile-field a {
    color: var(--primary-color);
    text-decoration: none;
}

.profile-field a:hover {
    text-decoration: underline;
}

.profile-text {
    margin: 0;
    line-height: 1.6;
}

.profile-summary {
    background: var(--surface);
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin: 10px 0 0 0;
    font-style: italic;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag {
    background: #dbeafe;
    color: var(--primary-hover);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    display: inline-block;
    font-weight: 500;
    border: 1px solid #bfdbfe;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

.success-section {
    background: var(--success-color);
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.success-section h3 {
    margin-bottom: 5px;
}

.success-content p {
    margin: 0;
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.profile-field label input[type="checkbox"] {
    display: inline;
    width: auto;
    margin-right: 8px;
}

/* Profile Preview Styles */
.preview-section {
    margin: 20px 0;
}

.preview-card {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.preview-card h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.preview-fields {
    margin: 15px 0;
}

.preview-field {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.preview-field:last-child {
    border-bottom: none;
}

.preview-field label {
    display: inline-block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 0.9rem;
    min-width: 120px;
}

.preview-field span {
    color: var(--text-primary);
    font-size: 1rem;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

.confidence-badge.high {
    background: #dcfce7;
    color: #166534;
}

.confidence-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.preview-warnings {
    margin: 15px 0;
}

.warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.warning-box.error {
    background: #fee2e2;
    border-color: #ef4444;
}

.warning-box h5 {
    margin: 0 0 10px 0;
    color: #92400e;
    font-size: 1rem;
}

.warning-box.error h5 {
    color: #991b1b;
}

.warning-box ul {
    margin: 0;
    padding-left: 20px;
}

.warning-box li {
    margin-bottom: 5px;
    color: #78350f;
}

.warning-box.error li {
    color: #7f1d1d;
}

.success-box {
    background: #dcfce7;
    border: 1px solid #22c55e;
    border-left: 4px solid #22c55e;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    color: #166534;
    font-weight: 600;
}

.preview-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Streaming Styles */
.streaming-content {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.streaming-progress {
    text-align: center;
    padding: 30px 20px;
}

.streaming-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.streaming-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.streaming-text-indicator {
    font-weight: 600;
    color: var(--primary-color);
}

.streaming-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.streaming-text {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.streaming-cursor {
    display: inline-block;
    width: 10px;
    background-color: var(--primary-color);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.streaming-dots {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
}

.streaming-dots::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

.streaming-hint {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

.streaming-error {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.streaming-error p {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.streaming-error pre {
    background: var(--surface);
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

/* Profile Recommendations Styles */
.recommendations-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.profile-summary-box {
    background: var(--highlight-bg);
    border: 1px solid var(--info-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.profile-summary-box h4 {
    color: var(--info-text);
    margin-bottom: 15px;
}

.profile-summary-box p {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Profile-specific overrides */
.recommendations-section .recommendations-list {
    gap: 20px;
    margin-bottom: 0;
}

.recommendations-section .recommendation-card {
    opacity: 1 !important;
}

.recommendations-section .recommendation-header {
    align-items: center;
}

.rank-badge {
    background: linear-gradient(135deg, #3498db 0%, #0a5499 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.relevance-score {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.dataset-title {
    margin: 10px 0;
    color: var(--text-primary);
}

.dataset-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.dataset-title a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.dataset-doi {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 5px 0;
}

.dataset-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 10px 0;
    padding: 10px;
    background: var(--surface-alt);
    border-radius: 4px;
}

.top-matching-cards {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.top-matching-cards h5 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.matching-card {
    background: var(--surface-alt);
    border-left: 3px solid var(--primary-color);
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.matching-card:last-child {
    margin-bottom: 0;
}

.dataset-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}
