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

/* FONTS */
@font-face {
    font-family: 'Roboto';
    src: url(assets/img/fonts/Roboto-Regular.ttf);
    font-weight: 400;
}

@font-face {
    font-family: 'Roboto';
    src: url(assets/img/fonts/Roboto-Bold.ttf);
    font-weight: 700;
}

/* COLORS */
:root {
    /* primary */
    --brand-color: rgb(99, 24, 24);
    --button: rgb(134, 28, 28);
    /* neutral */
    --dark: rgb(116, 21, 21);
    --light: rgb(238, 237, 253);
    --light-grey: rgb(230, 52, 52);
    --background-color: #f5eef7;
    background-color: var(--background-color);
}

body {
    min-height: 100vh;
    font-family: 'Roboto';
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--light-grey);
    background-color: var(--background-blue);
}

/* PAGE HEADING */
.page-heading {
    text-align: center;
    color: maroon;
    font-weight: 500;
    font-size: 30px;
    margin-bottom: 25px;
    margin-top: 73px;
}

.page-heading2 {
    text-align: center !important;
    color: rgb(22, 32, 49);
    font-weight: 500;
    font-size: 30px;
    margin-bottom: 25px;
    margin-top: 73px;
}

/* CONTAINER: Responsive grid */
.ca-profile-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    justify-items: center;
    padding: 90px;
    padding-top: 50px;
    margin-left: 10px;
    margin-right: 40px;
}

/* CARD - FIXED HEIGHT AND ALIGNMENT */
.ca-profile-card {
    width: 320px; 
    height: 470px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 14px;
    background-color: var(--light);
    box-shadow: 0px 3px 8px var(--dark);
    overflow: hidden; 
}

/* PROFILE IMAGE */
.ca-profile-pic {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-color);
    transition: all 0.3s ease;
    margin: 5px 0 5px 0;
}

/* DETAILS - FIXED HEIGHT AND STRUCTURE */
.ca-profile-details {
    flex: 1;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(#ca4c5d, #dd7881);
    border-radius: 50px 50px 14px 14px;
    text-align: center;
    overflow: hidden;
}

.ca-profile-name {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(255, 255, 255);
    margin: 0px 0 -5px 0;
    text-align: center;
    line-height: 1.2;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

/* DESCRIPTION - FIXED HEIGHT */
.ca-profile-description {
    font-size: 13px;
    line-height: 1.2;
    max-height: 35px;
    min-height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #090909;
    margin: 0px 6px 0px 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SOCIAL LINKS - FIXED HEIGHT */
.ca-profile-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 5px 0 10px 0;
    min-height: 30px;
    height: 30px;
}

.ca-profile-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.ca-profile-social-links a:hover {
    transform: translateY(-2px);
}

.ca-profile-social-links img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* BUTTONS - FIXED POSITION */
.ca-profile-button {
    margin: -10px 0px 0px 0;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ca-profile-button .btn {
    background-color: #551414;
    border-color: #a93030;
    padding: 3px 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 2px 22px 0 22px;
    color: white;
    text-decoration: none;
    display: inline-block;
    font-size: 15px;
}

.ca-profile-button .btn:hover {
    background-color: #3a0e0e;
    border-color: #8a2828;
    transform: translateY(-2px);
}

/* PROFILE INFO - FIXED HEIGHT AND ALIGNMENT */
.ca-profile-info {
    margin-top: 5px;
    padding: 0.5rem 0;
    border-top: 2px solid var(--dark);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 180px; /* Fixed height for info section */
}

.ca-profile-info h2 {
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgb(255, 255, 255);
    margin: 0;
    text-align: left;
    width: 100%;
    min-height: 25px;
    display: flex;
    align-items: center;
}

.ca-profile-info p {
    padding: 0.1rem 1rem;
    margin: 2px 0;
    font-size: 14px;
    border-radius: .4rem;
    display: block;
    color: #090909;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    line-height: 1.3;
    min-height: 40px; /* Fixed height for each info paragraph */
    display: flex;
    align-items: center;
}

/* SPECIFIC FIXES FOR CONSISTENT INFO SECTIONS */
.ca-profile-info > *:nth-child(1) { /* Qualifications heading */
    min-height: 25px;
}

.ca-profile-info > *:nth-child(2) { /* Qualifications content */
    min-height: 20px;
}

.ca-profile-info > *:nth-child(3) { /* Experience heading */
    min-height: 25px;
}

.ca-profile-info > *:nth-child(4) { /* Experience content */
    min-height: 20px;
}

.ca-profile-info > *:nth-child(5) { /* Email heading */
    min-height: 25px;
}

.ca-profile-info > *:nth-child(6) { /* Email content */
    min-height: 20px;
}

/* Banner Section */
.ca-banner {
    background: linear-gradient(135deg, #9c0f2254, #7a0c0c);
    color: #fff;
    padding: 80px 0;
}

.ca-banner .faculty-highlight {
    color: #fff;
}

.ca-banner .badge-wrapper .icon-circle {
    background: #fff;
    color: #6C55A3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* ================== RESPONSIVE BREAKPOINTS ================== */

/* Extra Large Desktops (1440px and above) */
@media (min-width: 1440px) {
    .ca-profile-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
        padding: 90px;
    }
}

/* Large Desktops (1200px to 1439px) */
@media (max-width: 1200px) and (min-width: 992px) {
    .ca-profile-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
        padding: 70px 40px;
    }
    .ca-profile-card {
        width: 300px;
        height: 460px;
    }
}

/* Medium Devices - Tablets and Small Laptops (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .ca-profile-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        padding: 60px 30px;
    }
    .ca-profile-card {
        width: 280px;
        height: 450px;
    }
    .page-heading {
        font-size: 28px;
        margin-top: 60px;
        margin-bottom: 20px;
    }
    .page-heading2 {
        font-size: 26px;
    }
}

/* Tablets (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .ca-profile-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 50px 25px;
    }
    .ca-profile-card {
        width: 100%;
        max-width: 320px;
        height: 440px;
    }
    .ca-profile-pic {
        width: 120px;
        height: 120px;
    }
    .page-heading {
        font-size: 26px;
        margin-top: 50px;
        margin-bottom: 15px;
    }
    .page-heading2 {
        font-size: 24px;
    }
    .ca-banner {
        padding: 60px 0;
    }
}

/* Small Tablets and Large Mobile (576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .ca-profile-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 40px 20px;
    }
    .ca-profile-card {
        width: 100%;
        height: auto;
        min-height: 420px;
    }
    .ca-profile-pic {
        width: 110px;
        height: 110px;
        margin: 8px 0;
    }
    .ca-profile-details {
        border-radius: 40px 40px 14px 14px;
    }
    .ca-profile-name {
        font-size: 0.95rem;
        min-height: 35px;
        margin: 0px 0 -3px 0;
    }
    .ca-profile-description {
        font-size: 12px;
        min-height: 28px;
    }
    .ca-profile-info {
        min-height: 160px;
    }
    .ca-profile-info p {
        min-height: 35px;
        font-size: 13px;
    }
    .page-heading {
        font-size: 24px;
        margin-top: 40px;
        margin-bottom: 10px;
    }
    .page-heading2 {
        font-size: 22px;
    }
    .ca-banner {
        padding: 50px 0;
    }
    .ca-banner .hero-image img {
        width: 380px !important;
        height: 300px !important;
    }
}

/* Mobile Devices (425px to 575px) */
@media (max-width: 575px) and (min-width: 425px) {
    .ca-profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 15px;
    }
    .ca-profile-card {
        width: 100%;
        max-width: 350px;
        height: auto;
        min-height: 400px;
        margin: 0 auto;
    }
    .ca-profile-pic {
        width: 100px;
        height: 100px;
    }
    .ca-profile-details {
        border-radius: 30px 30px 14px 14px;
        padding: 5px;
    }
    .ca-profile-name {
        font-size: 1rem;
        min-height: 32px;
        margin: 2px 0 -2px 0;
    }
    .ca-profile-description {
        font-size: 12px;
        min-height: 26px;
        margin: 2px 6px;
    }
    .ca-profile-social-links {
        margin: 3px 0 8px 0;
    }
    .ca-profile-button {
        margin: -8px 0px 0px 0;
    }
    .ca-profile-info {
        min-height: 150px;
    }
    .ca-profile-info h2 {
        font-size: 0.85rem;
        min-height: 22px;
    }
    .ca-profile-info p {
        min-height: 32px;
        font-size: 12px;
    }
    .page-heading {
        font-size: 22px;
        margin-top: 30px;
        margin-bottom: 8px;
    }
    .page-heading2 {
        font-size: 20px;
    }
    .ca-banner {
        padding: 40px 0;
    }
    .ca-banner .hero-image img {
        width: 320px !important;
        height: 250px !important;
        margin-top: 20px !important;
    }
    .faculty-highlight {
        margin-top: 20px !important;
    }
}

/* Small Mobile Devices (375px to 424px) */
@media (max-width: 424px) and (min-width: 375px) {
    .ca-profile-container {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 25px 12px;
    }
    .ca-profile-card {
        width: 100%;
        height: auto;
        min-height: 380px;
    }
    .ca-profile-pic {
        width: 95px;
        height: 95px;
    }
    .ca-profile-name {
        font-size: 0.95rem;
        min-height: 30px;
        padding: 0 8px;
    }
    .ca-profile-description {
        font-size: 11px;
        min-height: 24px;
    }
    .ca-profile-info {
        min-height: 140px;
    }
    .ca-profile-info h2 {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
    }
    .ca-profile-info p {
        font-size: 11px;
        min-height: 30px;
        padding: 0.1rem 0.8rem;
    }
    .page-heading {
        font-size: 20px;
        margin-top: 25px;
    }
    .page-heading2 {
        font-size: 18px;
    }
    .ca-banner {
        padding: 30px 0;
    }
    .ca-banner .hero-image img {
        width: 280px !important;
        height: 220px !important;
    }
    .teacher-heading {
        font-size: 1.5rem !important;
    }
    .hero-description {
        font-size: 0.9rem !important;
    }
}

/* Extra Small Mobile Devices (320px to 374px) */
@media (max-width: 374px) {
    .ca-profile-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 10px;
    }
    .ca-profile-card {
        width: 100%;
        height: auto;
        min-height: 360px;
    }
    .ca-profile-pic {
        width: 85px;
        height: 85px;
    }
    .ca-profile-details {
        border-radius: 25px 25px 14px 14px;
    }
    .ca-profile-name {
        font-size: 0.9rem;
        min-height: 28px;
    }
    .ca-profile-description {
        font-size: 10px;
        min-height: 22px;
    }
    .ca-profile-social-links {
        gap: 6px;
    }
    .ca-profile-social-links a {
        width: 20px;
        height: 20px;
    }
    .ca-profile-button .btn {
        font-size: 13px;
        padding: 2px 8px;
    }
    .ca-profile-info {
        min-height: 130px;
    }
    .ca-profile-info h2 {
        font-size: 0.75rem;
        min-height: 20px;
    }
    .ca-profile-info p {
        font-size: 10px;
        min-height: 28px;
        line-height: 1.2;
    }
    .page-heading {
        font-size: 18px;
        margin-top: 20px;
        margin-bottom: 5px;
    }
    .page-heading2 {
        font-size: 16px;
    }
    .ca-banner {
        padding: 25px 0;
    }
    .ca-banner .hero-image img {
        width: 250px !important;
        height: 200px !important;
    }
    .teacher-heading {
        font-size: 1.3rem !important;
    }
    .hero-description {
        font-size: 0.8rem !important;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .ca-profile-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }
    .ca-profile-card {
        height: 350px;
        min-height: 350px;
    }
    .ca-profile-pic {
        width: 80px;
        height: 80px;
    }
    .ca-profile-info {
        min-height: 120px;
    }
}

/* Modal Styles - Responsive */
.faculty-modal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.faculty-modal .modal-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.faculty-modal .modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.faculty-modal .btn-close {
    filter: invert(1);
}

.faculty-modal .profile-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #f0f0f0;
    margin: 0 auto 1rem;
    display: block;
}

.faculty-modal .profile-section {
    margin-bottom: 1.5rem;
}

.faculty-modal .profile-section h5 {
    color: #0d6efd;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.faculty-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.faculty-info-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.faculty-info-item h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.faculty-info-item p {
    margin-bottom: 0;
    color: #6c757d;
}

.social-links-modal {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links-modal a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #0d6efd;
    transition: all 0.3s ease;
}

.social-links-modal a:hover {
    background-color: #0d6efd;
    color: white;
    transform: translateY(-3px);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .faculty-modal .modal-body {
        padding: 1rem;
    }
    .faculty-modal .profile-img {
        width: 120px;
        height: 120px;
    }
    .faculty-info-grid {
        grid-template-columns: 1fr;
    }
    .social-links-modal a {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .faculty-modal .modal-header {
        padding: 1rem;
    }
    .faculty-modal .modal-body {
        padding: 0.8rem;
    }
    .faculty-modal .profile-img {
        width: 100px;
        height: 100px;
    }
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading-content {
    animation: pulse 1.5s ease-in-out infinite;
}

.faculty-details .p {
    color: rgb(65, 63, 63);
}

.modal-title {
    color: #f5eef7;
}