/* Tooltip styles */
.prof-summary-tooltip-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 0.5rem;
    z-index: 999;
    pointer-events: auto;
    overflow: visible !important;
}
/* Theme variables */
:root {
    --primary: #0D1024; /* deep navy requested */
    --primary-hover: #11142a;
}

/* Override Tailwind purple utilities to use the project's primary color */
.text-purple-600 { color: var(--primary) !important; }
.text-purple-700 { color: var(--primary) !important; }
.text-purple-800 { color: var(--primary) !important; }
.border-purple-600 { border-color: var(--primary) !important; }
.bg-purple-50 { background-color: rgba(13,16,36,0.03) !important; }
.hover\:text-purple-600:hover { color: var(--primary) !important; }
.hover\:text-purple-700:hover { color: var(--primary) !important; }
.hover\:text-purple-800:hover { color: var(--primary) !important; }
.hover\:bg-purple-50:hover { background-color: rgba(13,16,36,0.03) !important; }
.focus\:ring-purple-500:focus { box-shadow: 0 0 0 3px rgba(13,16,36,0.12) !important; }


/* Graduation-cap replacement logo */
.cap-logo {
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}
/* Utility border classes using theme primary */
.border-primary {
    border-left: 4px solid var(--primary) !important;
}

.border-primary-3 {
    border-left: 3px solid var(--primary) !important;
}
.summary-oneliner {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #203663;
    font-size: 0.98em;
    font-weight: 500;
    cursor: pointer;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.25rem 0.75rem;
    box-shadow: 0 2px 8px rgba(99,102,241,0.04);
    transition: background 0.18s;
    min-width: 120px;
    max-width: 320px;
    text-align: left;
    outline: none;
}

/* Add any custom CSS here that is not easily done with Tailwind */

/* Subtle animation for the header */
header {
    animation: slideInTop 0.8s ease-out;
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for results loading */
.professor-card {
    animation: slideInUp 0.6s ease-out;
}

/* === Profile Image Styles === */
.profile-container {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.profile-placeholder {
    color: #94a3b8;
    font-size: 2rem;
    text-align: center;
}

/* === Professor Links Styles === */
.professor-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.professor-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1.5px solid #93c5fd;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 0;
}

.professor-link:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.professor-link.profile {
    color: #0D1024;
    border-color: #93c5fd;
}

.professor-link.profile:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.professor-link.scholar {
    color: #0D1024;
    border-color: #93c5fd;
}

.professor-link.scholar:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.professor-link.scopus {
    color: #0D1024;
    border-color: #93c5fd;
}

.professor-link.scopus:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.professor-link.email {
    color: #2563eb;
    border-color: #93c5fd;
}

.professor-link.email:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

/* === Professor Position and Department Styles === */
.professor-department {
    color: #1a0475;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.professor-position {
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-publications {
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.recent-publications i {
    color: #10b981;
}

/* === Matching Keywords Styles === */
.match-keyword {
    background: #e0e7ff;
    color: #210b45;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    box-shadow: none;
    display: inline-block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-container {
        width: 48px;
        height: 48px;
    }
    
    .professor-links {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .professor-link {
        width: 100%;
        justify-content: center;
        min-width: 0;
        font-size: 0.875rem;
    }
}
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    text-align: center;
    padding: 2rem 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
}

/* Cards */
.card {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.card p {
    margin-bottom: 1.25rem;
    color: var(--gray-600);
}

.subtext {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn .material-icons {
    font-size: 1.125rem;
    margin-right: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

/* Loading spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Tags */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tag.keytag {
    background-color: #c7d2fe;
    color: #3730a3;
    border: 1px solid #a5b4fc;
}

.editable-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    margin: 0.125rem;
    background-color: #818cf8;
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.editable-tag:hover {
    background-color: #a5b4fc;
    transform: translateY(-1px);
}

.tag-remove-btn {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s ease;
    z-index: 20;
    opacity: 1;
    pointer-events: auto;
}

.tag-remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.refresh-rankings-btn {
    transition: all 0.2s ease;
}

.refresh-rankings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Team section */
.team-container {
    margin-bottom: 1.5rem;
}

.team-member {
    padding: 1rem;
    border-radius: var(--radius);
    background-color: var(--gray-100);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}

.team-member-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.team-member-name {
    font-weight: 600;
    color: var(--gray-900);
}

.team-member-dept {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.team-member-position {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.team-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.team-member-tag {
    background-color: var(--gray-200);
    color: var(--gray-700);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.team-member-link {
    margin-top: 0.75rem;
}

.team-member-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

.team-member-link a:hover {
    text-decoration: underline;
}

.team-member-link .material-icons {
    font-size: 1rem;
    margin-right: 0.25rem;
}

/* Accordion for experts by area */
.accordion {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--gray-200);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background-color: var(--gray-100);
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-header:hover {
    background-color: var(--gray-200);
}

.accordion-title {
    font-weight: 500;
}

.accordion-icon {
    transition: transform 0.2s;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
}

.accordion-content-inner {
    padding: 1rem;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

/* Professor cards inside accordion */
.professor-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.professor-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    background-color: white;
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
    overflow: visible;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-height: 320px;
}

.professor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.professor-name {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.professor-dept {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.professor-score {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.professor-links {
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.professor-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.75rem;
}

.professor-links a:hover {
    text-decoration: underline;
}

/* Multi-domain expert header */
.professor-card .mb-4.p-3.rounded-lg {
    border-radius: 10px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}

.professor-card .mb-4.p-3.rounded-lg.bg-red-50 {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.professor-card .mb-4.p-3.rounded-lg.bg-purple-50 {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

/* Domain badge container */
.professor-card .mb-4:has(.domain-badge) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

/* Professor profile and links section */
.professor-card h4.text-xl {
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.professor-card h4.text-xl::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 40px;
    background-color: #3A819B;
    border-radius: 2px;
}

/* Professor contact info */
.professor-card p.text-gray-600.mb-3.flex.items-center {
    background-color: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Dropdown footer */
.prof-card-footer {
    background: linear-gradient(to bottom, #ffffff, #f9fafb) !important;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 12px 16px !important;
}

/* Key domains section */
#domains-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.domain-card {
    background-color: var(--gray-100);
    padding: 0.75rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.domain-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.domain-score {
    background-color: var(--primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Domain badges for multi-domain experts */
.domain-badge {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.domain-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.critical-domain {
    background-color: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.normal-domain {
    background-color: #f5f7fb;
    border-color: #e2e8f0;
    color: #334155;
}

.critical-domain .font-semibold {
    color: #e11d48;
    display: flex;
    align-items: center;
}

.critical-domain .font-semibold::before {
    content: "🔍";
    margin-right: 6px;
    font-size: 14px;
}

/* Subdomain tag count and coverage indicator */
.domain-badge .text-xs {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

/* Improve domain badge layout */
.domain-badge .flex.items-center.justify-between {
    gap: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Grouping message */
.grouping-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--light);
    border-left: 4px solid var(--info);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 1.5rem;
}

/* Subdomain coverage tags */
.covered-tag {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.missing-tag {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.critical-tag {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-weight: 600;
}

/* Score information styling */
.score-info {
    font-size: 0.85rem;
}

/* Coverage information styling */
.coverage-info {
    background-color: #fafafa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}

.covered-subdomains b {
    color: #047857;
}

.missing-subdomains b {
    color: #dc2626;
}

/* Enhanced Tag-wise table subdomain alternating colors */
.bg-purple-25 {
    background-color: rgba(139, 92, 246, 0.08) !important;
}

.bg-blue-25 {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.border-purple-200 {
    border-color: #e9d5ff !important;
}

.border-blue-200 {
    border-color: #dbeafe !important;
}

/* Subdomain header styling */
.subdomain-header-purple {
    background-color: rgba(139, 92, 246, 0.15) !important;
    color: #581c87 !important;
    font-weight: 700 !important;
}

.subdomain-header-blue {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #1e3a8a !important;
    font-weight: 700 !important;
}

/* Email styling enhancements */
.email-display {
    color: #3314AD !important;
    font-weight: 500 !important;
}

.email-icon {
    color: #3314AD !important;
}

/* Professor card enhancements */
.professor-card {
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
    overflow: hidden;
}

.professor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Simple Team Card Styles */
.professor-card {
    transition: all 0.2s ease;
}

.professor-card:hover {
    transform: translateY(-1px);
}

/* Utility for consistent icon width */
.w-4 {
    width: 1rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 640px) {
    .professor-card .flex-wrap {
        flex-direction: column;
    }
    
    .professor-card .flex-wrap > span {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Team summary bar enhancements */
#team-summary-bar {
    background: linear-gradient(135deg, #f5f3ff 0%, #e0e7ff 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    border-radius: 12px !important;
    padding: 20px !important;
    transition: all 0.3s ease;
}

#team-summary-bar:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.15);
}

#team-summary-bar h2 {
    color: #4c1d95 !important;
    font-weight: 800 !important;
    position: relative;
    display: inline-block;
    margin-bottom: 16px !important;
}

#team-summary-bar h2::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, #1a254d, #4c1d95);
    border-radius: 3px;
}

#team-summary-bar .grid.grid-cols-1.md\\:grid-cols-2.gap-4 {
    margin: 16px 0 !important;
}

#team-summary-bar .bg-white.rounded-lg.p-3 {
    border-radius: 10px !important;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 12px 16px !important;
    transition: transform 0.2s ease;
}

#team-summary-bar .bg-white.rounded-lg.p-3:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

#team-summary-bar .bg-red-50 {
    background-color: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    border-radius: 10px !important;
    padding: 14px !important;
}

#team-summary-bar .text-sm.text-gray-600.italic {
    background-color: white;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    margin-top: 10px !important;
    font-style: normal !important;
    display: flex;
    align-items: center;
}

/* Tag-wise table enhancements */
.tag-wise-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.tag-wise-table thead {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
}

.tag-wise-table th {
    padding: 12px 16px !important;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.tag-wise-table td {
    padding: 12px 16px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #e2e8f0;
}

/* Alternating subdomain backgrounds */
.tag-wise-table tr[class*="bg-purple-25"] {
    background-color: rgba(139, 92, 246, 0.04) !important;
}

.tag-wise-table tr[class*="bg-blue-25"] {
    background-color: rgba(59, 130, 246, 0.04) !important;
}

/* Vertical subdomain headers */
.tag-wise-table td[class*="subdomain-header-purple"],
.tag-wise-table td[class*="subdomain-header-blue"] {
    border-right: 2px solid;
}

.tag-wise-table td[class*="subdomain-header-purple"] {
    background-color: rgba(139, 92, 246, 0.08) !important;
    border-right-color: rgba(139, 92, 246, 0.3);
}

.tag-wise-table td[class*="subdomain-header-blue"] {
    background-color: rgba(59, 130, 246, 0.08) !important;
    border-right-color: rgba(59, 130, 246, 0.3);
}

/* Tag cells */
.tag-wise-table td.px-4.py-2.border-b.align-top.font-semibold.text-purple-700 {
    font-weight: 600;
    color: #1a254d;
    background-color: rgba(245, 243, 255, 0.5);
}

/* Professor tags in table */
.tagwise-prof-display {
    position: relative;
    padding-right: 10px;
    transition: all 0.2s ease;
    margin-right: 6px;
    margin-bottom: 5px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    min-width: 150px;
}

.tagwise-prof-display .tagwise-profile-link {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

/* Enhanced professor action icons */
.tagwise-prof-display .prof-action-icons {
    position: relative;
    display: none;
    z-index: 5;
    animation: fadeIn 0.2s ease;
    gap: 6px;
    margin-left: 6px;
}

.tagwise-prof-display:hover .prof-action-icons {
    display: flex;
}

.tagwise-prof-display .prof-action-icons a {
    background-color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.tagwise-prof-display .prof-action-icons a:hover {
    transform: scale(1.2);
}

.tagwise-prof-display .prof-action-icons .email-icon {
    color: #16a34a;
}

.tagwise-prof-display .prof-action-icons .email-icon:hover {
    background-color: #dcfce7;
}

.tagwise-prof-display .prof-action-icons .scholar-icon {
    color: #4285F4;
}

.tagwise-prof-display .prof-action-icons .scholar-icon:hover {
    background-color: #dbeafe;
}

/* Alternative professor dropdown enhancements */
.alt-prof-container {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.alt-prof-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.alt-prof-header i {
    color: #1a254d;
}

.alt-prof-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alt-prof-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #f9fafb;
    color: #374151;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.alt-prof-select:hover {
    border-color: #d1d5db;
    background-color: #f3f4f6;
}

.alt-prof-select:focus {
    outline: none;
    border-color: #3A819B;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Style the options when dropdown is open */
.alt-prof-select option {
    padding: 10px;
    font-size: 0.9rem;
}

.alt-prof-select option.full-coverage {
    color: #059669;
}

.alt-prof-select option.partial-coverage {
    color: #d97706;
}

.alt-prof-select option.no-coverage {
    color: #dc2626;
}

.alt-prof-tip {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    padding-left: 4px;
}

.alt-prof-tip i {
    color: #3A819B;
    font-size: 0.85rem;
}

/* Missing domains visualization */
.missing-domains-container {
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.missing-domains-header {
    display: flex;
    align-items: center;
    color: #be123c;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.missing-domains-header i {
    color: #e11d48;
}

.missing-domains-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.missing-domain-item {
    display: flex;
    align-items: center;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
    color: #9f1239;
    gap: 6px;
}

.missing-domain-item.missing-critical {
    background-color: #fecaca;
    border-color: #fca5a5;
}

.critical-badge {
    background-color: #ef4444;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.missing-domains-tip {
    background-color: white;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
}

.missing-domains-tip i {
    color: #f59e0b;
}

/* Enhanced professor info card styling */
.prof-info-card {
    background-color: #fafafa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}

.prof-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.prof-header h4 {
    margin-bottom: 4px !important;
}

.prof-position {
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

.prof-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.prof-department, .prof-email {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.prof-department {
    color: #3314AD;
    font-weight: 600;
}

.prof-department i, .prof-email i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

.prof-email a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
}

.prof-email a:hover {
    color: #3314AD;
    text-decoration: underline;
}

.prof-links {
    display: flex;
    gap: 12px;
}

.prof-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.prof-profile-link {
    background-color: #f5f3ff;
    color: #1a254d;
    border: 1px solid #ddd6fe;
}

.prof-profile-link:hover {
    background-color: #ede9fe;
    box-shadow: 0 2px 4px rgba(109, 40, 217, 0.1);
}

.prof-scholar-link {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.prof-scholar-link:hover {
    background-color: #dbeafe;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

/* Enhanced domain expertise header */
.domain-expertise-header {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.domain-expertise-header.has-critical {
    background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
    border: 1px solid #fecdd3;
}

.domain-expertise-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #3314AD;
}

.domain-expertise-header.has-critical .domain-expertise-title {
    color: #be123c;
}

.domain-expertise-title i {
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Domain Pills Grid (New improved layout) */
.domain-pills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.domain-pill {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.domain-pill:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.critical-domain-pill {
    background: #fef2f2;
    border-color: #fecaca;
}

.critical-domain-pill:hover {
    border-color: #f87171;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.normal-domain-pill {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.normal-domain-pill:hover {
    border-color: #3314AD;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.domain-pill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.domain-pill-name {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.critical-badge {
    background: #fecaca;
    color: #991b1b;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-card {
    will-change: transform;
    position: relative;
    overflow: visible;
}

.tag-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.tag-dropdown {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.professor-item {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.2s ease;
}

.professor-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tag-card .fas.fa-chevron-down {
    transition: transform 0.2s ease;
}

.tag-card .fas.fa-chevron-down.rotate-180 {
    transform: rotate(180deg);
}

/* Team card styling with colored borders */
.professor-card.team-card-critical {
    border-top: 4px solid #ef4444; /* Red border for critical experts */
    border-left: 4px solid var(--primary);
}

.professor-card.team-card-normal {
    border-top: 4px solid #3b82f6; /* Blue border for normal experts */
    border-left: 4px solid var(--primary);
}

/* Improved domain section layout */
.domain-section-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    min-height: 2.5rem; /* Ensure consistent height */
}

.domain-count-info {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.domain-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Ensure domain tags have consistent spacing */
.domain-tags-container .inline-flex {
    margin: 0; /* Remove default margins since we're using gap */
}

/* Responsive improvements for domain section */
@media (max-width: 640px) {
    .domain-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}



/* ===== Startup labels (Startups tab) and the startup-founder icon (faculty cards) ===== */
.startup-labels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.startup-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72rem; font-weight: 600; line-height: 1; letter-spacing: 0.01em;
    padding: 5px 10px; border-radius: 9999px; border: 1px solid transparent; white-space: nowrap;
}
.startup-label i { font-size: 0.7rem; }
.startup-label--fsid     { background: #111827; color: #fb923c; border-color: #fb923c; }   /* black + orange */
.startup-label--artpark  { background: #1d4ed8; color: #ffffff; border-color: #1d4ed8; }   /* blue */
.startup-label--founded  { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }   /* soft green outline */
.startup-label--conclave { background: #e5e7eb; color: #4b5563; border-color: #d1d5db; }   /* grey */
.startup-desc-missing { color: #9ca3af; font-style: italic; font-size: 0.875rem; }

.faculty-startup-badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    margin-left: 10px; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 9999px;
    font-size: 0.8rem; font-weight: 700; cursor: default; border: 1px solid transparent;
}
.faculty-startup-badge--fsid     { background: #111827; color: #fb923c; border-color: #fb923c; }
.faculty-startup-badge--artpark  { background: #1d4ed8; color: #fff; }
.faculty-startup-badge--founded  { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.faculty-startup-badge--conclave { background: #e5e7eb; color: #4b5563; }
.faculty-startup-badge--advisor { background: #f3f4f6; color: #374151; border-color: #d1d5db; }   /* advisor: neutral grey handshake */

/* Floating tooltip (script.js initAppTooltip): any element with a data-tip attribute */
.app-tooltip {
    position: fixed; z-index: 99999; top: 0; left: 0; max-width: 360px;
    background: #fff; color: #000; border: 1px solid #bbb; border-radius: 6px;
    font-size: 13px; line-height: 1.45; padding: 8px 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    white-space: pre-line; pointer-events: none; opacity: 0; transition: opacity 0.1s ease;
}   /* identical look to the Expertise Summary tooltip */
.app-tooltip.show { opacity: 1; }
.faculty-startup-badge:focus-visible, .startup-label:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }

/* ---- faculty contact block (IISc Directory first, else web) ---- */
.professor-contact { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; font-size: 0.82rem; line-height: 1.35; }
.professor-contact--compact { margin: 0 0 8px; padding: 6px 8px; font-size: 0.75rem; min-height: 5.2rem; }
.professor-contact--none { color: #9ca3af; font-style: italic; background: transparent; border-style: dashed; display: flex; align-items: center; gap: 6px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: #374151; }
.contact-row + .contact-row { margin-top: 5px; }
.contact-row > i { width: 14px; text-align: center; color: #7c3aed; font-size: 0.75rem; }
.contact-row--more { opacity: 0.85; }
.contact-label { color: #6b7280; }   /* no fixed width: the number sits right after its label */
.contact-link { color: #4c1d95; text-decoration: none; word-break: break-all; font-variant-numeric: tabular-nums; }
.contact-link:hover { text-decoration: underline; }
.contact-sep { color: #9ca3af; }
.contact-row--web, .contact-row--web .contact-label, .contact-row--web .contact-link { color: #9ca3af; }
.contact-row--web > i { color: #c4b5fd; }
.contact-row[data-tip] { cursor: default; }
/* every contact box has the same minimum height (room for email + Centrex + Direct), so cards line up whether or not contact exists */
.professor-contact { min-height: 6rem; box-sizing: border-box; }
.professor-contact--compact { min-height: 5.2rem; }

/* ---- Results view toggle (cards / list) ---- */
#view-toggle { gap: 0; }
.view-btn { border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: .85rem; padding: .35rem .8rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.view-btn:first-of-type { border-radius: 8px 0 0 8px; }
.view-btn:last-of-type { border-radius: 0 8px 8px 0; margin-left: -1px; }
.view-btn.active { background: var(--primary, #0D1024); color: #fff; border-color: var(--primary, #0D1024); }

/* List view: one slim row per result - picture, name, links on the right; click the row to expand the details */
.view-list #faculty-results .grid, .view-list #alumni-results, .view-list #startups-results { grid-template-columns: 1fr !important; gap: .5rem !important; }
.view-list .professor-card { min-height: 0 !important; height: auto !important; cursor: pointer; }
.view-list .professor-card > .p-6 { display: grid !important; grid-template-columns: minmax(0, 1fr) auto 1.4rem; column-gap: 1rem; row-gap: .7rem; align-items: center; padding: .6rem 4rem .6rem 1rem !important; }
.view-list .professor-card > .p-6 > .flex.items-start { grid-column: 1; grid-row: 1; margin: 0 !important; align-items: center; min-width: 0; gap: .8rem; }
.view-list .professor-card > .p-6 > .professor-links { grid-column: 2; grid-row: 1; margin: 0 !important; flex-wrap: nowrap; gap: .4rem; }
.view-list .professor-card > .p-6::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .8rem; grid-column: 3; grid-row: 1; color: #64748b; transition: transform .2s; text-align: center; }
.view-list .professor-card.expanded > .p-6::after { transform: rotate(180deg); }
.view-list .professor-card > .p-6 > :not(.flex.items-start):not(.professor-links) { display: none; grid-column: 1 / -1; margin: 0 !important; }
.view-list .professor-card.expanded > .p-6 > :not(.flex.items-start):not(.professor-links) { display: block; }
.view-list .professor-card.expanded > .p-6 > .professor-contact--none { display: flex; }
.view-list .professor-card .profile-container, .view-list .professor-card .profile-image, .view-list .professor-card .profile-placeholder { width: 44px !important; height: 44px !important; min-width: 44px; font-size: 1.5rem; }
.view-list .professor-card h3 { font-size: 1.02rem !important; margin: 0 !important; }
.view-list .professor-card .flex.items-center.mb-2 { margin-bottom: 0 !important; }
.view-list .professor-card .professor-department, .view-list .professor-card .professor-position { display: inline-block; margin: 0 .9rem 0 0; font-size: .78rem; }
.view-list .professor-card .recent-publications { display: none; }
.view-list .professor-card .professor-link { padding: .25rem .6rem; font-size: .78rem; }
.view-list .professor-card > button.absolute { top: 50% !important; right: .9rem !important; transform: translateY(-50%); }
.view-list .professor-card > .absolute:not(button) { top: .5rem !important; right: .9rem !important; }
.view-list .professor-card.expanded [class*="startup-description"] { display: block; -webkit-line-clamp: unset; }
.view-list .professor-card .startup-toggle-btn { display: none; }

/* ---- Collapsible "Research Tags & Expert Availability" ---- */
.tagwise-toggle { background: none; border: 0; padding: 0; cursor: pointer; }
.tagwise-count { margin-left: .75rem; font-size: .8rem; font-weight: 500; color: #6b7280; background: #eef0f6; border-radius: 999px; padding: .15rem .6rem; }
.tagwise-chevron { font-size: .9rem; transition: transform .2s; }
.tagwise-toggle.open .tagwise-chevron { transform: rotate(180deg); }
.tagwise-body[hidden], .explanation-body[hidden] { display: none; }

/* ---- Find-by-name link ---- */
.name-search-link { position: fixed; top: 86px; right: 20px; z-index: 40; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px; background: #fff; color: #0D1024; border: 1px solid #d1d5db; font-size: .85rem; font-weight: 600; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.name-search-link:hover { background: #0D1024; color: #fff; }


/* "Understanding your search": a two-line preview until expanded */
.explanation-body.collapsed { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .5rem; }

/* ---- Evidence drawer ---- */
.evidence-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 94vw); background: #fff; color: #1f2937; z-index: 1100; display: flex; flex-direction: column;
  box-shadow: -10px 0 34px rgba(15, 23, 42, .22); transform: translateX(105%); transition: transform .25s ease; visibility: hidden; }
.evidence-drawer.open { transform: none; visibility: visible; }
.evidence-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.evidence-head h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary, #0D1024); margin: 0; }
.evidence-head p { margin: 6px 0 0; font-size: .78rem; color: #64748b; line-height: 1.9; }
.evidence-head button { border: 0; background: #eef2f7; color: #475569; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: none; }
.evidence-head button:hover { background: #dde5ef; }
.evidence-body { padding: 6px 18px 28px; overflow-y: auto; flex: 1; }
.ev-section { margin-top: 18px; }
.ev-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #334155; padding-bottom: 6px; border-bottom: 2px solid var(--primary, #0D1024); margin-bottom: 4px; }
.ev-count { font-weight: 500; text-transform: none; letter-spacing: 0; color: #94a3b8; }
.ev-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.ev-rank { width: 20px; height: 20px; border-radius: 50%; background: #eef2f7; color: #64748b; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.ev-item:first-of-type .ev-rank { background: var(--primary, #0D1024); color: #fff; }
.ev-title { font-size: .9rem; font-weight: 600; color: #1f2937; line-height: 1.35; }
.ev-link { color: inherit; text-decoration: none; } .ev-link:hover { text-decoration: underline; color: #1d5fd1; }
.ev-ext { font-size: .62rem; margin-left: 5px; color: #94a3b8; }
.ev-meta { font-size: .76rem; color: #64748b; margin-top: 2px; }
.ev-sum { font-size: .76rem; color: #475569; margin-top: 4px; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ev-chip { background: #e8eefb; color: #27408b; border-radius: 99px; padding: 0 8px; font-size: .68rem; font-weight: 500; line-height: 1.5; display: inline-block; }
.ev-chip--q { background: #eef6f1; color: #1d5c44; margin-left: 4px; }
.ev-empty { color: #94a3b8; font-size: .9rem; margin-top: 20px; }
.professor-card.evidence-active { outline: 2px solid var(--primary, #0D1024); outline-offset: 2px; }
