/* ═══════════════════════════════════════════════════════════════════════════
   IIT Guwahati ME Faculty Supervisor Selection Portal — Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --primary: #1a237e;
    --primary-light: #283593;
    --primary-dark: #0d1642;
    --accent: #ff6f00;
    --accent-light: #ff8f00;
    --accent-dark: #e65100;
    --bg-light: #f5f7fa;
    --text-dark: #212121;
    --text-muted: #757575;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 30px rgba(26, 35, 126, 0.18);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */

.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand img {
    height: 40px;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.navbar-brand .brand-sub {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.85;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
    margin: 0 2px;
}

.nav-link:hover, .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

.nav-link i {
    margin-right: 5px;
}

.user-badge {
    background: var(--accent);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Hero Section ───────────────────────────────────────────────────────────── */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent-dark) 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero .subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 8px;
    position: relative;
}

.hero .tagline {
    font-size: 1rem;
    opacity: 0.75;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.hero .accent-line {
    width: 80px;
    height: 4px;
    background: var(--accent);
    margin: 20px auto;
    border-radius: 2px;
    position: relative;
}

/* ─── Search & Filter ────────────────────────────────────────────────────────── */

.search-section {
    background: white;
    padding: 25px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background: var(--bg-light);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    background: white;
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 6px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

.filter-pill:hover, .filter-pill.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ─── Section Headers ────────────────────────────────────────────────────────── */

.section-header {
    text-align: center;
    margin: 50px 0 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60%;
    height: 3px;
    background: var(--accent);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-header .spec-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 0.95rem;
}

/* ─── Faculty Cards ──────────────────────────────────────────────────────────── */

.faculty-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
}

.faculty-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
}

.faculty-card .card-top {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.faculty-card .card-top::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid var(--primary-light);
}

.faculty-card .avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    margin: 0 auto 12px;
    object-fit: cover;
    background: rgba(255,255,255,0.1);
}

.faculty-card .card-top h5 {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.faculty-card .card-top .designation {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    font-weight: 400;
}

.faculty-card .card-body {
    padding: 25px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.faculty-card .research-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.faculty-card .research-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.faculty-card .card-footer-custom {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faculty-card .email-link {
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition);
}

.faculty-card .email-link:hover {
    color: var(--accent);
}

.faculty-card .room-badge {
    background: var(--bg-light);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-profile {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
}

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

/* ─── Profile Modal ──────────────────────────────────────────────────────────── */

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body .profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    margin: 0 auto 15px;
    display: block;
}

.modal-body .research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.research-tag {
    background: rgba(26, 35, 126, 0.08);
    color: var(--primary);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ─── Login Page ─────────────────────────────────────────────────────────────── */

.login-container {
    max-width: 480px;
    margin: 60px auto;
    padding: 0 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.login-card .login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.login-card .login-header h2 {
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card .login-header p {
    opacity: 0.85;
    font-size: 0.9rem;
}

.login-card .login-header .login-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.login-card .login-body {
    padding: 35px 30px;
}

.form-floating {
    margin-bottom: 20px;
}

.form-floating input {
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    font-family: 'Poppins', sans-serif;
    padding: 1rem 0.75rem;
}

.form-floating input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.form-floating label {
    font-family: 'Poppins', sans-serif;
    color: var(--text-muted);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.3);
    color: white;
}

/* ─── Selection Page ─────────────────────────────────────────────────────────── */

.selection-info {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    border-left: 5px solid var(--accent);
}

.selection-info h5 {
    color: var(--primary);
    font-weight: 600;
}

.selection-counter {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 25px rgba(26, 35, 126, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transition: var(--transition);
}

.selection-counter .count {
    font-size: 1.4rem;
    font-weight: 700;
}

.selection-counter .count-label {
    font-size: 0.8rem;
    opacity: 0.85;
}

.btn-save-selections {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.btn-save-selections:hover {
    background: var(--accent-dark);
    color: white;
    transform: scale(1.05);
}

.select-card {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    margin-bottom: 12px;
}

.select-card:hover {
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(26, 35, 126, 0.1);
}

.select-card.selected {
    border-color: var(--accent);
    background: rgba(255, 111, 0, 0.04);
}

.select-card .select-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    flex-shrink: 0;
}

.select-card .select-info {
    flex: 1;
}

.select-card .select-info h6 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.select-card .select-info .select-research {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.select-card .select-info .select-designation {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.select-card .select-checkbox {
    width: 24px;
    height: 24px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.select-card .select-rank {
    background: var(--accent);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0;
    transition: var(--transition);
}

.select-card.selected .select-rank {
    opacity: 1;
}

/* ─── Rankings Page ──────────────────────────────────────────────────────────── */

.rankings-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 50px 0;
    text-align: center;
}

.rankings-hero h1 {
    font-weight: 700;
}

.rankings-hero p {
    opacity: 0.85;
}

.rank-card {
    background: white;
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.rank-card:hover {
    transform: translateX(5px);
    box-shadow: var(--card-hover-shadow);
}

.rank-position {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
}

.rank-position.gold { color: #FFD700; }
.rank-position.silver { color: #C0C0C0; }
.rank-position.bronze { color: #CD7F32; }

.rank-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
}

.rank-info h6 {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.rank-info .rank-spec {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.rank-bar-container {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-bar {
    flex: 1;
    height: 10px;
    background: #e8eaf6;
    border-radius: 5px;
    overflow: hidden;
}

.rank-bar .rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 5px;
    transition: width 1s ease;
}

.rank-count {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
    min-width: 30px;
    text-align: right;
}

.no-rankings {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-rankings i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */

.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    font-size: 0.85rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer .footer-brand {
    font-weight: 600;
    color: white;
    font-size: 1rem;
    margin-bottom: 8px;
}

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */

.alert-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .hero .subtitle {
        font-size: 1rem;
    }
    .rank-bar-container {
        flex: 0 0 100px;
    }
    .selection-counter {
        bottom: 15px;
        right: 15px;
        padding: 12px 18px;
    }
    .filter-pills {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .rank-bar-container {
        display: none;
    }
}

/* ─── Animations ─────────────────────────────────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.faculty-card {
    animation: fadeIn 0.5s ease backwards;
}

.faculty-card:nth-child(1) { animation-delay: 0.05s; }
.faculty-card:nth-child(2) { animation-delay: 0.1s; }
.faculty-card:nth-child(3) { animation-delay: 0.15s; }
.faculty-card:nth-child(4) { animation-delay: 0.2s; }
.faculty-card:nth-child(5) { animation-delay: 0.25s; }
.faculty-card:nth-child(6) { animation-delay: 0.3s; }
