/* ==============================================
   IIT Madras Faculty Search - Professional Design
   Refined Typography, Spacing & Visual Hierarchy
   ============================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* IITM Brand Colors - Refined Palette */
    --iitm-primary: #1e3a5f;
    --iitm-primary-dark: #0d1f33;
    --iitm-primary-light: #2d4a6f;
    --iitm-secondary: #9b1b30;
    --iitm-secondary-light: #b82d43;
    --iitm-accent: #c9853d;
    --iitm-accent-light: #e09b4f;
    --iitm-accent-dark: #e09b4f;

    /* Refined Neutrals */
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f6f8;
    --bg-hover: #eef1f4;
    --text-primary: #1a1d21;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --border-light: #e8ecf1;
    --border-medium: #d1d9e2;
    --border-dark: #b8c4d0;

    /* Refined Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(201, 133, 61, 0.2);
    --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 11px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    /* font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; */
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.011em;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* login icon */

.input-wrapper {
    position: relative;
}

.input-wrapper #togglePassword {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
}

.input-wrapper #togglePassword:hover {
    color: #555;
}

/* make room so the eye icon doesn't overlap typed text */
.input-wrapper input[type="password"],
.input-wrapper input[type="text"] {
    padding-right: 35px;
}



/* ==============================================
   SEARCH - Refined Hero Section
   ============================================== */

.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.search-filter-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    margin: 1rem auto 1.5rem;
    max-width: 1400px;
}

.search-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    /* padding: 0.5rem 1.25rem; */
    margin: 0;
    flex: 1.8;
    max-width: none;
    position: relative;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.search-box:hover {
    box-shadow: var(--shadow-xl);
}

.search-box:focus-within {
    box-shadow: var(--shadow-xl), var(--shadow-focus);
}

.search-input-wrapper {
    display: flex;
    gap: 0.75rem;
    flex-direction: row;
    /* makes them side-by-side */
    align-items: center;
}


/* Search Input */
.search-input-container {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    overflow: hidden;
    background: white;
    width: 100%;
}

.search-input-container:focus-within {
    border-color: var(--iitm-accent);
    box-shadow: var(--shadow-focus);
}

.search-input {
    flex: 1 1;
    padding: 0.625rem 1rem;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: linear-gradient(180deg, #d4e2f5, #9b1b3000, #c9853d2b);
    font-weight: 450;

}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* .search-type {

    background: linear-gradient(180deg, #d4e2f5, #9b1b3000, #c9853d2b);
/* } */
.search-type {
  border: none;
    outline: none;
    font-size: 0.875rem;
    font-weight: 250;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
     background: linear-gradient(180deg, #d4e2f5, #9b1b3000, #c9853d2b);
}
.search-btn {
    padding: 0 1.25rem;
    border: none;
    background: var(--iitm-accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-base);
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--iitm-accent-light);
}

.search-btn:active {
    background: var(--iitm-accent-dark);
}

.search-btn svg {
    width: 18px;
    height: 18px;
}

.ai-notice {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: #fffbeb;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--iitm-accent);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: #92400e;
    font-weight: 500;
}

/* ==============================================
   FILTERS - Horizontal Bar
   ============================================== */

.content-layout {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
}

.filters-sidebar {
    width: auto;
    max-width: none;
    margin: 0;
    flex: 1.5;
    /* background: var(--bg-secondary); */
    background: linear-gradient(180deg, #d4e2f5, #9b1b3000, #c9853d2b);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
}

.filters-sidebar:hover {
    box-shadow: var(--shadow-xl);
}

.filters-header {
    display: flex;
    align-items: center;
    position: static;
    margin-right: 0.5rem;
}

.filters-header svg {
    color: var(--iitm-primary);
    width: 18px;
    height: 18px;
}

.filters-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-group label.filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    position: relative;
}

.filter-group label.filter-label:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.filter-label-text {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    /* count badge is positioned absolutely, not inline */
}

.dropdown-arrow {
    transition: transform var(--transition-base);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.selected-count {
    position: absolute;
    top: -7px;
    right: -7px;
    background: var(--iitm-secondary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    box-shadow: 0 1px 4px rgba(155, 27, 48, 0.45);
    border: 2px solid var(--bg-secondary);
    z-index: 1;
    line-height: 1;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    margin-top: 0.25rem;
    height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all var(--transition-smooth);
    padding: 0 0.5rem;
}

.filter-dropdown.open {
    height: 180px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    padding: 0.5rem;
}

.filter-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    outline: none;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.filter-search:focus {
    border-color: var(--iitm-accent);
    box-shadow: var(--shadow-focus);
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.filter-option:hover {
    background: var(--bg-tertiary);
}

.filter-option input[type='checkbox'] {
    width: 0.875rem;
    height: 0.875rem;
    accent-color: var(--iitm-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

/* .filter-option span {
    margin-left: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 450;
} */
.filter-option span:not(.count) {
    margin-left: 0.625rem;
    margin-right: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 450;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    min-width: 0;
}

/* .filter-option .count {
    /* background: var(--iitm-primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    min-width: 1.5rem;
    text-align: center;
    margin-left: auto;
    flex-shrink: 0;
} */
.filter-option .title-with-badge {
    margin-left: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 450;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    /* space between text and badge */
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.filter-option .title-with-badge .count {
    background: var(--iitm-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0 0.35rem;
    border-radius: 999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-option .count {
    background: var(--iitm-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0 0.35rem;
    border-radius: 999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

.reset-filters {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-medium);
    background: white;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 0.5rem;
}

.reset-filters:hover {
    background: var(--bg-tertiary);
    border-color: var(--iitm-secondary);
    color: var(--iitm-secondary);
}

/* ==============================================
   RESULTS GRID - Faculty Cards
   ============================================== */

.results-area {
    width: 100%;
}

.results-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 500;
    text-align: center;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* ==============================================
   PAGINATION
   ============================================== */

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin: 2rem 0 1.5rem;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1.5px solid var(--border-medium);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
    box-shadow: var(--shadow-xs);
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--iitm-primary);
    color: var(--iitm-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.page-btn.active {
    background: var(--iitm-primary);
    border-color: var(--iitm-primary);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.35);
    cursor: default;
    transform: translateY(-1px);
}

.page-btn.disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.page-btn svg {
    flex-shrink: 0;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.05em;
    user-select: none;
}

/* ==============================================
   PAGE SIZE SELECTOR
   ============================================== */

.fs-pagesize-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.fs-pagesize-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--iitm-primary);
}

.fs-pagesize-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%234a5568' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.fs-pagesize-select:hover {
    border-color: var(--iitm-primary);
}

.fs-pagesize-select:focus {
    outline: none;
    border-color: var(--iitm-primary);
    box-shadow: var(--shadow-focus);
}

#resultsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ================================================
   FACULTY CARD  â€” Redesigned Formal Layout
   ================================================ */

.faculty-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.faculty-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--iitm-primary);
    transform: translateY(-3px);
}

/* Top gradient accent bar */
.card-accent-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--iitm-primary), var(--iitm-secondary), var(--iitm-accent));
    flex-shrink: 0;
}

.card-identity {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.25rem 1rem;
}



.card-identity-text {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-designation-badge {
    display: block;
    align-items: center;
    /* background: #eef2f7; */
    /* color: var(--iitm-primary); */
    /* border: 1px solid #c8d6e8; */
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
   /* padding: 0.2rem 0.6rem;
     border-radius: var(--radius-full); */
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-department-text {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-left: 2px solid var(--border-medium);
    padding-left: 0.5rem;
}

/* Thin grey divider */
.card-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0 1.25rem;
}

/* Research areas */
.card-research {
    padding: 0.75rem 1.25rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.research-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.research-label svg {
    color: var(--iitm-accent);
    flex-shrink: 0;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
    max-height: 75px;
    overflow-y: auto;
    padding-right: 0.25rem;
    align-content: flex-start;
}

/* Custom thin scrollbar for tags area */
.card-tags::-webkit-scrollbar {
    width: 4px;
}

.card-tags::-webkit-scrollbar-track {
    background: transparent;
}

.card-tags::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Override for profile modal - keep expanded without scrollbar */
.profile-interests .card-tags {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    background: #f0f4fa;
    color: var(--iitm-primary);
    border: 1px solid #ccd8ea;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 100%;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
}

.card-tag:hover {
    background: var(--iitm-primary);
    color: #ffffff;
    border-color: var(--iitm-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.25);
}

.no-tags {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

/* Card Footer */
.card-footer {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-citations {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-citations svg {
    color: var(--iitm-accent);
    flex-shrink: 0;
}

.footer-citations strong {
    color: var(--iitm-secondary);
    font-weight: 700;
    font-size: 0.875rem;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--iitm-secondary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
}

.empty-state {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 3.5rem 2rem;
    text-align: center;
    border: 1px solid var(--border-light);
    margin: 0 auto;
    width: fit-content;
    left: 50%;
    align-items: center;

}

.empty-icon {
    width: 56px;
    height: 56px;
    color: var(--border-medium);
    margin: 0 auto 1.25rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    margin-top: 0.75rem;
}

.scroll-loader .spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
}

/* ==============================================
   PROFILE MODAL
   ============================================== */

.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

.profile-modal-header {
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.profile-fullscreen-btn,
.profile-close-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.profile-fullscreen-btn:hover {
    background: var(--iitm-accent);
    color: white;
}

.profile-close-btn:hover {
    background: var(--iitm-secondary);
    color: white;
}

.profile-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--bg-primary);
}

.profile-container {
    display: flex;
    gap: 0;
    max-width: 100%;
    margin: 0;
    height: 100%;
}

.profile-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    padding: 1.75rem;
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
}

.profile-main {
    flex: 1;
    min-width: 0;
    padding: 1.75rem;
    overflow-y: auto;
}

/* Profile Section Styles */
.profile-header-section {
    text-align: center;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.edit-profile-simple {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
}

.edit-profile-simple:hover {
    background: var(--iitm-accent);
    color: white;
    border-color: var(--iitm-accent);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--iitm-primary), var(--iitm-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 1.25rem;
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.25);
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    word-break: break-word;
    width: 100%;
}

.profile-designation {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* .profile-department-badge {
    display: inline-block;
    /* background: #fef7ed;
    color: #9a3412; */
    /* padding: 0.3rem 0.75rem;
    /* border-radius: var(--radius-full); */
    /* font-size: 0.7rem;
    font-weight: 600;
    /* border: 1px solid #fed7aa; */
    /* margin-top: 0.1rem;
} */

.profile-contact {
    margin: 1.25rem 0;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.contact-item svg {
    flex-shrink: 0;
    color: var(--iitm-primary);
    width: 16px;
    height: 16px;
}

.contact-item a {
    color: var(--iitm-accent);
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.contact-item a:hover {
    text-decoration: underline;
}

.stats-section {
    margin: 1.25rem 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--iitm-secondary);
    margin-bottom: 0.125rem;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-info {
    margin: 1.25rem 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    margin-bottom: 0.375rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.info-item:hover {
    background: var(--bg-hover);
}

.info-item svg {
    flex-shrink: 0;
    color: var(--iitm-primary);
    width: 16px;
    height: 16px;
}

.info-item a {
    color: var(--iitm-accent);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.info-item a:hover {
    text-decoration: underline;
}

.profile-interests {
    margin: 1.25rem 0;
}

.publications-section {
    margin-bottom: 1.75rem;
}

.section-header {
    display: block;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--border-light);
}

.section-header svg {
    color: var(--iitm-primary);
    width: 20px;
    height: 20px;
}

.section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}


.pub-updated-badge {
    margin-left: auto;
}

.pub-updated-badge button {
    background: #fed7aa;
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: default;
    margin-left: 40em;
    margin-bottom:0.5rem;

}


.publication-item {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 0.75rem;
    transition: all var(--transition-fast);
}

.publication-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-medium);
}

.publication-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.publication-authors {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.publication-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.publication-meta a {
    color: var(--iitm-accent);
    text-decoration: none;
    font-weight: 600;
}

.publication-meta a:hover {
    text-decoration: underline;
}

/* Fullscreen Mode */
.profile-modal.fullscreen {
    padding: 0;
}

.profile-modal.fullscreen .profile-modal-content {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
}

/* ==============================================
   MODAL & FORMS
   ============================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.25s ease;
}

.modal-header {
    /* padding: 1.25rem 1.5rem; */
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--iitm-secondary);
}

.modal-body {
    /* padding: 1.5rem; */
    padding: 15px 16px;

}

.modal-description {
    color: var(--text-secondary);
    /* margin-bottom: 1.25rem; */
    margin-bottom: 2px;
    font-size: 0.875rem;
}

.form-group {
    /* margin-bottom: 1rem; */
    margin-bottom: 12px;
}

/*additional */
.input-wrapper {
    display: flex;
    align-items: center;
    /* border: 1px solid #ddd; */
    border-radius: 8px;
    /* padding: 6px 10px;   */
    background: #f9fafb;
}

/* Icon */
.input-wrapper .icon {
    margin-right: 6px;
    font-size: 14px;
}

/* Inputs */
.input-wrapper input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    flex: 1;
}

/* Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    /* 🔽 reduced */
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 8px 14px;
    /* 🔽 smaller buttons */
    font-size: 13px;
    border-radius: 8px;
}

.form-group label {
    /* display: block;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem; */
    font-size: 13px;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--iitm-accent);
    box-shadow: var(--shadow-focus);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.readonly-field {
    background: var(--bg-tertiary) !important;
    cursor: not-allowed;
    border: 1px solid var(--border-medium);
}

.modal-actions,
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--iitm-accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--iitm-accent-light);
    box-shadow: 0 2px 8px rgba(201, 133, 61, 0.25);
}

.btn-secondary {
    background: linear-gradient(135deg, #f98f164f, #ea580c);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--iitm-secondary);
    color: var(--iitm-secondary);
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    margin-top: 0.875rem;
    font-size: 0.8125rem;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    margin-top: 0.875rem;
    font-size: 0.8125rem;
}

/* ==============================================
   EDIT PROFILE PAGE
   ============================================== */

.profile-header {
    background: linear-gradient(135deg, var(--iitm-primary), var(--iitm-primary-dark));
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.edit-profile-container {
    max-width: 840px;
    margin: 1.75rem auto;
    padding: 0 1.75rem;
}

.edit-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xs);
}

.edit-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.image-upload-container {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.image-preview {
    flex-shrink: 0;
}

.avatar-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--iitm-primary), var(--iitm-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.25);
}

.image-upload-controls {
    flex: 1;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 1200px) {
    #resultsContainer {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1.25rem;
    }

    .header h1 {
        font-size: 1.375rem;
    }

    .search-box {
        /* padding: 1.5rem 1.25rem; */
        margin: 1rem;
        border-radius: var(--radius-lg);
    }

    .search-container {
        padding: 0 1rem;
        width: 100%;
    }

    .filters-sidebar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .filter-group {
        min-width: 100%;
    }

    #resultsContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-container {
        flex-direction: column;
    }

    .profile-container {
        flex-direction: column;
        height: auto;
    }

    .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        overflow-y: visible;
        max-height: none;
        flex-shrink: 0;
    }

    .profile-main {
        overflow-y: visible;
        min-height: 0;
    }

    .profile-modal-content {
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 480px) {
    .header-logo-section {
        gap: 0.875rem;
    }

    .iitm-logo {
        height: 48px;
    }

    .header h1 {
        font-size: 1.125rem;
    }

    .header-subtitle {
        font-size: 0.6875rem;
    }

    /* .search-input {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    } */

    .search-btn {
        padding: 0 1.25rem;
    }

    .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.375rem;
    }

    .stat-card {
        padding: 0.5rem;
    }

    .stat-value {
        font-size: 1rem;
    }
}

/* ==============================================
   SCROLLBAR STYLING
   ============================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* ==============================================
   SELECTION STYLING
   ============================================== */

::selection {
    background: rgba(201, 133, 61, 0.2);
    color: var(--text-primary);
}

/* ==============================================
   FOCUS VISIBLE STYLING
   ============================================== */

:focus-visible {
    outline: 2px solid var(--iitm-accent);
    outline-offset: 2px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform var(--transition-smooth);
    font-weight: 600;
    font-size: 0.875rem;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--iitm-accent);
    outline-offset: 2px;
}

/*span tag design*/
.interests-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* .tag {
    display: inline-block;
    background: #f1f1f1;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 13px;
    color: #333;
    border: 1px solid #ddd;
} */

/*edit button design*/
.edit-btn {
    display: block;
    margin: 5px auto;
    background: #fef7ed;
    color: #9a3412;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #fed7aa;

}

.edit-btn:hover {
    background: #fed7aa;
    color: #7c2d12;
}

/* Main form container */
form {
    /* max-width: 900px; */
    /* margin: 30px auto; */
    background: #ffffff;
    /* padding: 25px; */
    border-radius: 16px;
    /* box-shadow: 0 10px 30px rgba(0,0,0,0.08); */
}

/* Section card */
.edit-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: 0.3s ease;
}

/* Hover lift effect */
.edit-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Section title */
.edit-section h3 {
    margin-bottom: 15px;
    color: #c2410c;
    font-size: 17px;
    font-weight: 600;
    position: relative;
}

/* Small underline accent */
.edit-section h3::after {
    content: '';
    width: 40px;
    height: 3px;
    background: #fb923c;
    position: absolute;
    bottom: -5px;
    left: 0;
    border-radius: 5px;
}

/* Row layout */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* Form group */
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Labels */
.form-group label {
    font-size: 13px;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

/* Inputs */
.form-group input,
.form-group textarea {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    transition: all 0.25s ease;
    /* background: #f9fafb; */
}

/* Focus glow */
.form-group input:focus,
.form-group textarea:focus {
    background: #fff;
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
}



/* Actions section */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}

/* Hover effect */
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.4);
}

/* Secondary button */
.btn-secondary {
    background: #f1f5f9;
    color: #333;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/*login stle*/
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
    padding: 6px 6px;
    border-radius: 8px;
    background: #fff;
}

.input-wrapper i {
    font-size: 16px;
    color: #6b7280;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.input-wrapper input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    background: transparent;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    color: #374151;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9999;
}

.modal-content {
    width: 420px;
    max-width: 92%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: popIn 0.25s ease;
}

@keyframes popIn {
    from {
        transform: translateY(10px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 18px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    color: #111;
}

/*checkbox design*/


.view-toggle-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    /* pushes to right of search/filter row */
}

.view-toggle-container :hover {
    box-shadow: var(--shadow-xl);
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.view-toggle input {
    accent-color: #f3931c;
    /* orange theme match */
    cursor: pointer;
}

/*datatable design*/


table.dataTable {

    /* table-layout : fixed !important; */
    /* border-collapse: collapse;
    width: 100% !important; */

    border-collapse: separate;
    border-spacing: 0 12px;
    /* creates card-like gap */

}

#facultyTable {
    display: table;
    width: 100%;
    align-items: center;
    justify-content: center;
}

table.dataTable th {
    background: #f5f7fb;
    padding: 12px;
    text-align: left;
    white-space: nowrap;
}

table.dataTable td {
    padding: 12px;
    vertical-align: top;
}

.table-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;


}

.table-tag {
    background: #eef2ff;
    color: #3730a3;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    /* display:inline-flex; */
    /* white-space: nowrap; */
    white-space: normal;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: center;
    line-height: 1.3;
}

#facultyTable tbody tr:hover::after {

    transition: 0.6s;
    box-shadow: var(--shadow-xl);


}

.table-tags::-webkit-scrollbar {
    height: 4px;
}

.table-tags::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.datatable-wrapper {

    overflow-x: auto;
}


.search-type-dropdown {
    width: 140px;
    min-width: 140px;
    border: none;
    border-right: 1px solid #ddd;
    background: transparent;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    color: #444;
}

/* ==========================================
   MOBILE RESPONSIVE
========================================== */


/* EXTRA SMALL DEVICES */

@media (max-width: 480px) {

    .header h1 {
        font-size: 1.1rem;
    }

    .search-input,
    .filter-search {
        font-size: 15px;
    }

    .card-identity {
        padding: 1rem;
    }

    .card-research {
        padding: 0.75rem 1rem;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .profile-name {
        font-size: 1.1rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   FIX SEARCH + FILTER RESPONSIVENESS
========================================= */

@media (max-width: 768px) {

    .search-filter-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        align-items: stretch;
    }

    .search-input-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        /* IMPORTANT */
        overflow: hidden;

        /* prevents spill */
    }


    .search-box,
    .filters-sidebar,
    .view-toggle-container {
        width: 100%;
        max-width: 100%;
    }

    .search-box {
        margin: 0;
    }

    .search-input-wrapper {
        width: 100%;
    }


    /*
    .search-input {
        width: 100%;
        min-width: 0;
    } */
    .search-input {
        min-width: 0;
        flex: 1;
    }

    /* .search-btn {
        width: 100%;
        justify-content: center;
    } */
    .search-btn {
        width: auto;
        padding: 0 1rem;
    }

    .filters-sidebar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
        min-width: 100%;
    }

    /* Fix 1: "All" search-type dropdown was tiny/cramped on mobile
       because it doesn't auto-stretch inside a column flex container. */
    .search-type {
        width: 100%;
        padding: 0.75rem 1rem;
        box-sizing: border-box;
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-secondary);
    }

    .search-input-container {
        overflow: hidden;
    }

    /* Fix 2: filter-dropdown (Department / Research Area) was position:absolute
       with a fixed height, so opening it covered whatever sat below it
       (the next filter, or the results) instead of pushing layout down.
       On mobile, use a fixed centered panel with a backdrop instead. */
    .filter-dropdown {
        position: fixed;
        top: 50%;
        left: 1rem;
        right: 1rem;
        bottom: auto;
        transform: translateY(-50%);
        width: auto;
        max-width: calc(100% - 2rem);
        margin-top: 0;
        z-index: 1000;
        box-shadow: var(--shadow-xl);
    }

    .filter-dropdown.open {
        height: auto;
        max-height: 70vh;
    }

    .filter-group {
        position: static;
    }

    /* Backdrop behind the open dropdown so it reads as an overlay,
       not broken/overlapping layout */
    .filter-dropdown.open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: -1;
    }

    .view-toggle-container {
        justify-content: center;
        margin-left: 0;
        flex-wrap: wrap;
    }

       .datatable-wrapper {
        width: 100%;
        overflow-x: auto !important;   /* ENABLE SCROLL ONLY HERE */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    #facultyTable {
        width: max-content !important;  /* FORCE EXPAND */
        min-width: 100% !important;
        table-layout: auto !important;
    }

    #facultyTable th,
    #facultyTable td {
        white-space: nowrap !important; /* PREVENT WRAP */
    }


}




/* =========================
   BASE LAYOUT
========================= */
.profile-container {
    display: flex;
    height: 100%;
    gap: 0;
}

/* LEFT SIDEBAR */
.profile-sidebar {
    width: 320px;
    background: #f8fafc;
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
}

/* RIGHT CONTENT */
.profile-main {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #ffffff;
}

/* =========================
   MODERN PROFILE CARD STYLE
========================= */
.profile-header-section {
    text-align: center;
    margin-bottom: 1.2rem;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.profile-designation {
    font-size: 0.9rem;
    color: #6b7280;
}

.profile-department-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 999px;

    color: #3730a3;
}

/* =========================
   CONTACT CARD
========================= */
.profile-contact {
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

/* =========================
   STATS CARD (MODERN)
========================= */
.stats {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.stat-card {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 12px;
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* =========================
   PUBLICATIONS (MODERN CARDS)
========================= */
.publication-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: 0.2s;
}

.publication-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.publication-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

/* =========================
   TAGS (MODERN CHIPS)
========================= */
.tag {
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 10px;
    /* border-radius: 999px; */
    font-size: 0.75rem;
}

/* =========================
   MOBILE RESPONSIVE (IMPORTANT)
========================= */
@media (max-width: 768px) {

.pub-updated-badge button {
        background: #fed7aa;
        border: 1.5px solid var(--border-medium);
        border-radius: var(--radius-sm);
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--text-secondary);
        cursor: default;
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    .profile-container {
        flex-direction: column;
        height: auto;
    }

    .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem;
        overflow-y: visible;
        max-height: none;
        flex-shrink: 0;
    }

    .profile-main {
        padding: 1rem;
        overflow-y: visible;
        min-height: 0;
    }

    /* make stats horizontal scroll safe */
    .stats {
        flex-direction: row;
        overflow-x: auto;
    }

    .stat-card {
        min-width: 120px;
    }

    /* publication spacing */
    .publication-item {
        padding: 0.85rem;
    }

    .profile-name {
        font-size: 1.1rem;
    }
    .profile-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    .profile-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
}
