.speakers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.speaker-card {
    background-color: #fff;
    padding: 10px;
    margin: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background 0.3s, color 0.3s;
    color: #000;
    cursor: pointer; /* Makes it look clickable */
  min-height: 400px;
}

.speaker-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(45deg, #272b75, #CB7A2D); /* Dark Blue to Red */
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Ensure all text turns white */
.speaker-card:hover * {
    color: #fff !important;
}

.speaker-card img {
    width: 180px;
    height: 240px;
    border-radius: 10%;
    object-fit: cover;
    object-position: center 15%;
    border: 0.1px solid var(--primary_color);
}

.speaker-card h3 {
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
    color: #333;
}

.speaker-card p {
    font-size: 16px;
    color: #555;
}

.speaker-card .company_name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin: 2px 0 1px;
}

.speaker-card .company_address {
    font-size: 1em;
    color: #555;
}

.speaker-card .company_designation {
    font-size: 0.95em;
    font-weight: normal;
    color: #555;
    margin-top: 5px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 30px; /* Ensures space even if empty */
    align-items: center;
}

.social-icon {
    color: #333;
    font-size: 18px;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

/* Ensure hover effect */
.social-icon:hover {
    color: var(--primary_color);
}

/* If no icons are present, keep space but hide visibility */
.social-links:empty {
    /*visibility: hidden;*/
}

.position {
    color: #666; /* Slightly lighter gray for the designation */
    font-size: 14px; /* Slightly smaller font size for the designation */
    margin-bottom: 10px; /* Space between designation and any other info */
    position: relative; /* For underline effect */
    display: inline-block; /* So the pseudo-element only spans the text width */
}

.position:hover::after {
    opacity: 1; /* Make the underline fully opaque on hover */
}

.btt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary_color);
    color: white;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease-in-out;
}

.btt:hover {
    background: var(--hover_color);
}

/* --- Team Modal Specific Styles --- */
.team-modal .modal-dialog {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    margin: 15px auto;
}

.team-modal .modal-content {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 95vh;
}

.team-modal .modal-header {
    flex-shrink: 0;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
}

.team-modal .modal-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Removed align-items: center; and text-align: center; from here */
    align-items: flex-start; /* Align content to the left */
    text-align: left; /* Align text to the left */
}

.team-modal .modal-image {
    max-width: 150px;
    height: auto;
    border-radius: 10%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    align-self: center; /* Keep image centered if desired, overrides flex-start on modal-body */
}

.team-modal .modal-body h3 {
    font-size: 1.5em;
    margin-bottom: 5px;
    align-self: center; /* Keep name centered */
}

.team-modal .modal-body .position {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
    align-self: center; /* Keep position centered */
}

.team-modal .modal-body .description {
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 1em;
    text-align: left;
    width: 100%; /* Ensure description takes full width for left alignment */
}

/* Adjusted social links styling for modal */
.team-modal .modal-social-links { /* Changed class name to avoid conflict and target specifically */
    margin-top: 15px;
    width: 100%; /* Ensure it takes full width */
    display: flex;
    justify-content: center; /* Still center social icons within their container */
    gap: 10px;
}

.team-modal .modal-social-links .btn {
    margin: 0 5px;
    font-size: 0.9em;
}

.team-modal .modal-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    border-bottom-right-radius: calc(0.3rem - 1px);
    border-bottom-left-radius: calc(0.3rem - 1px);
}

.team-modal .btn-close {
    margin-left: auto;
}

/* Styles for the Member Forums section within the modal */
.team-modal .member-forums-section {
    padding: 20px; /* Add padding for the background */
    background-color: #f0f0f0; /* Slightly different background color */
    border-radius: 8px; /* Slightly rounded corners */
    margin-top: 20px; /* Space from content above */
    width: 100%; /* Take full width within the modal body */
    text-align: left; /* Ensure overall section text aligns left */
}

.team-modal .member-forums-section h2 {
    text-align: center; /* Keep the heading centered within its section */
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.team-modal .member-forums-section .member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Adjusted minmax slightly */
    gap: 10px;
    justify-items: start; /* Align grid items to the start (left) */
}

.team-modal .member-forums-section .member-card {
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center; /* Keep card content centered */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    width: 100%; /* Ensure cards take full width of their grid column */
}

.team-modal .member-forums-section .member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.team-modal .member-forums-section .member-card img {
    max-width: 80px;
    max-height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.team-modal .member-forums-section .member-card p {
    font-size: 0.85em;
    color: #555;
    margin: 0;
    line-height: 1.2;
}

/* Styles for the individual company designation in the modal */
.team-modal .member-forums-section .member-card .company-member-designation {
    font-size: 0.8em;
    color: #777;
    margin-top: 3px;
    line-height: 1.1;
}

@media (max-width: 576px) {
    .team-modal .modal-dialog {
        margin: 10px auto;
    }
    .team-modal .member-forums-section .member-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    .team-modal .member-forums-section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
}

/* Original styles for the Member Forums section (if this section is also displayed outside the modal) */
/* Keeping these separate as they might be for a different context (e.g., full page section) */
.member-forums-section { /* This affects the main page section, not the modal version */
    padding: 40px 0;
    background-color: #f8f8f8;
}

.member-forums-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: #333;
}

.member-grid { /* This affects the main page section, not the modal version */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* Original member-card styles for main page section (if applicable) */
.member-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.member-card img {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.member-card p {
    font-size: 0.95em;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

/* Responsive adjustments for member section */
@media (max-width: 768px) {
    .member-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .member-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .member-card {
        width: 90%; /* Make cards take more width on small screens */
    }
}
