/* Expert Directory CSS - Phase 2 Implementation */

/* Base expert card styling */
.expert-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e8e8e8;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* AI-powered expert card distinction */
.expert-card.ai-powered {
    border: 2px solid #4a6bff;
    background: linear-gradient(135deg, #ffffff, #f8f9ff);
    box-shadow: 0 4px 6px rgba(74, 107, 255, 0.1);
}

.expert-card.ai-powered::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a6bff, #6a5acd);
}

.expert-card.ai-powered::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a6bff, #6a5acd);
}

/* Expert photo styling */
.expert-photo-container {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.expert-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.expert-photo-container::after {
    content: '👤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #999;
    background: rgba(255, 255, 255, 0.8);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI capability badge */
.ai-capability-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(74, 107, 255, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.ai-capability-badge::before {
    content: '⚡';
    font-size: 1.2em;
}

/* Expert name and title */
.expert-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.expert-title {
    font-size: 0.9rem;
    color: #6a5acd;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Expert biography */
.expert-biography {
    color: #555;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Expert skills tags */
.expert-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.expert-skill-tag {
    background: #f0f4ff;
    color: #4a6bff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #d0d9ff;
}

/* Expert actions */
.expert-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Hover effects and micro-animations */
.expert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(74, 107, 255, 0.15);
}

.expert-card:hover .expert-photo {
    transform: scale(1.05);
}

.expert-card:hover .ai-capability-badge {
    animation: pulse 1.5s infinite;
}

.expert-card:hover .expert-skill-tag {
    background: #e8efff;
    transform: translateY(-2px);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 107, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(74, 107, 255, 0);
    }
}

/* Expert directory section */
.expert-directory-section {
    margin-top: 60px;
}

.expert-section-header {
    text-align: center;
    margin-bottom: 30px;
}

.expert-section-title {
    font-size: 2rem;
    color: #1a237e;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Domain-specific icons for expert cards */
.expert-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.expert-icon.architect::before {
    content: '🏛️';
}

.expert-icon.detective::before {
    content: '🔍';
}

.expert-icon.garden::before {
    content: '🌿';
}

.expert-icon.mechanics::before {
    content: '⚙️';
}

.expert-icon.opus::before {
    content: '🤖';
}

.expert-icon.room::before {
    content: '🏠';
}

.expert-icon.document::before {
    content: '📄';
}

.expert-icon.urban::before {
    content: '🏙️';
}

.expert-icon.cuisine::before {
    content: '🍳';
}

.expert-section-subtitle {
    color: #666;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Expert grid layout */
.expert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Filter controls */
.expert-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    z-index: 10;
}

/* Search bar for expert directory */
.expert-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.expert-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.2s;
    min-width: 250px;
}

.expert-search-input:focus {
    border-color: #4a6bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.1);
}

.expert-search-icon {
    color: #999;
    font-size: 1.2rem;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #4a6bff;
    color: #4a6bff;
}

.filter-btn.active {
    background: #4a6bff;
    color: white;
    border-color: #4a6bff;
}

/* Responsive design */
@media (max-width: 1024px) {
    .expert-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .expert-grid {
        grid-template-columns: 1fr;
    }

    .expert-section-title {
        font-size: 1.6rem;
    }

    .expert-filters {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .expert-card {
        padding: 18px;
    }

    .expert-name {
        font-size: 1.2rem;
    }

    .expert-biography {
        -webkit-line-clamp: 3;
    }
}

/* Modal for expert details */
.expert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.expert-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.expert-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.expert-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.expert-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.expert-detail-header {
    text-align: center;
    margin-bottom: 20px;
}

.expert-detail-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    border: 4px solid #4a6bff;
}

.expert-detail-name {
    font-size: 1.8rem;
    color: #1a237e;
    font-weight: 600;
    margin-bottom: 5px;
}

.expert-detail-title {
    font-size: 1.1rem;
    color: #6a5acd;
    font-weight: 500;
    margin-bottom: 20px;
}

.expert-detail-section {
    margin-bottom: 25px;
}

.expert-detail-section h3 {
    color: #4a6bff;
    font-size: 1.2rem;
    margin-bottom: 12px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 8px;
}

.expert-detail-biography {
    color: #555;
    line-height: 1.7;
    font-size: 1rem;
}

.expert-detail-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.expert-detail-skill {
    background: #f0f4ff;
    color: #4a6bff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #d0d9ff;
}

/* Analysis demo section */
.analysis-demo {
    background: #f8f9ff;
    border: 2px dashed #d0d9ff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.analysis-demo h4 {
    color: #4a6bff;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-demo p {
    color: #666;
    margin-bottom: 15px;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a6bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}