/* ===========================
   INDEX.CSS
   Index/home page specific styles
   - Expert cards grid
   - Index-specific layouts
=========================== */

/* ===========================
   Loading State - Centered
=========================== */
#expertList.loading-state,
#expertList:has(.spinner-border) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#expertList .col-12.text-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 300px;
}

/* ===========================
   Expert Cards Grid - 3 cards per row, centered
=========================== */
#expertList {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    /*padding: 1rem;*/
    max-width: 1200px;
    margin: 0 auto;
}

#expertList > .expert-card,
#expertList > .card-expert {
    flex: 0 0 300px;
    max-width: 300px;
}

/* Expert Card - Search Results */
#expertList .expert-card,
#expertList .card-expert {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

#expertList .expert-card:hover,
#expertList .card-expert:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

#expertList .expert-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    height: 100%;
}

/* Avatar/Photo Container */
.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    margin: 0 auto;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 4rem;
    color: #ccc;
}

/* Card Title - Name (Blue, Bold, Uppercase) */
#expertList .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #082E72;
    text-transform: uppercase;
    margin: 0.75rem 0 0.5rem;
    line-height: 1.3;
}

/* Designation - Orange/Gold color */
.designation-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #C4792B !important;
    text-transform: uppercase;
    margin: 0.25rem 0 !important;
    line-height: 1.3;
}

/* Faculty - Blue color */
.faculty-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #082E72 !important;
    text-transform: uppercase;
    margin: 0.25rem 0 !important;
    line-height: 1.3;
}

/* Field/Department - Smaller text */
.field-text {
    font-size: 0.75rem;
    color: #666 !important;
    margin: 0.25rem 0 0.75rem !important;
    line-height: 1.4;
    flex-grow: 1;
    min-height: 1.4em;
}

/* Field of Interest loading state */
.foi-loading {
    color: #999;
    font-style: italic;
}

/* View Profile Button */
.btn-view-profile {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #082E72;
    color: #fff !important;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s ease;
    margin-top: auto;
    border: none;
}

.btn-view-profile:hover {
    background: #0a4199;
    text-decoration: none;
}

/* Highlight search matches */
#expertList mark {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

/* Legacy card-expert styles */
#expertList .card-expert {
    padding: 1.5rem;
    box-sizing: border-box;
}

#expertList .card-expert img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto;
    border: 3px solid #e0e0e0;
}

.card-expert h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #082E72;
    text-transform: uppercase;
    margin-top: 0.75rem;
}

.card-expert .expert-field {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.card-expert .btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #082E72;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
    margin-top: auto;
}

.card-expert .btn:hover {
    background: #0a4199;
    text-decoration: none;
}

/* ===========================
   Responsive Expert Cards - 3 columns to 2 to 1
=========================== */
@media (max-width: 992px) {
    #expertList > .expert-card,
    #expertList > .card-expert {
        flex: 0 0 280px;
        max-width: 280px;
    }
    
    #expertList .expert-card,
    #expertList .card-expert {
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    #expertList {
        gap: 1rem;
    }
    
    #expertList > .expert-card,
    #expertList > .card-expert {
        flex: 0 0 260px;
        max-width: 260px;
    }
    
    #expertList .expert-card .card-body,
    #expertList .card-expert {
        padding: 1rem;
    }

    .avatar-container,
    #expertList .card-expert img {
        width: 80px;
        height: 80px;
    }
    
    .avatar-placeholder {
        font-size: 3rem;
    }
    
    #expertList .card-title,
    .card-expert h5 {
        font-size: 0.85rem;
    }
    
    .designation-text,
    .faculty-text {
        font-size: 0.75rem;
    }
    
    .field-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    #expertList {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    #expertList > .expert-card,
    #expertList > .card-expert {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #expertList .expert-card,
    #expertList .card-expert {
        min-height: auto;
    }
}

/* ===========================
   Index Page Search Section
=========================== */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-section h2 {
    text-align: center;
    color: #082E72;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* ===========================
   Welcome Section
=========================== */
.welcome-section {
    text-align: center;
    padding: 3rem 1rem;
    color: #fff;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome-section p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 1.8rem;
    }

    .welcome-section p {
        font-size: 1rem;
    }
}

/* ===========================
   Results Counter
=========================== */
.results-count {
    text-align: center;
    padding: 1rem;
    font-size: 1.1rem;
    color: #333;
}

.results-counter {
    width: 100%;
    flex-basis: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
}

.results-count strong {
    color: #007bff;
}

/* ===========================
   No Results Message
=========================== */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.no-results h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 0.95rem;
}
