:root {
    --primary-color: #10b981; /* Emeral green for light bg */
    --primary-hover: #059669;
    --bg-color: #ffffff; /* White background */
    --card-bg: #ffffff; /* White cards */
    --text-main: #2f4f4f; /* darkslategrey */
    --text-muted: #475569; /* Muted slate for readability */
    --keyword-bg: #f1f5f9;
    --keyword-text: #334155;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.logo-container {
    /* Resets any bottom margin as it's now handled by the wrapper's gap/flex layout */
    margin-bottom: 0;
}

.main-logo {
    max-width: 250px;
    height: auto;
    filter: brightness(0); /* Black logo */
}

h1 {
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 0; /* Margin handled by wrapper */
    font-weight: 400; /* Texto normal */
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.search-box {
    max-width: 900px; /* Cuadro de búsqueda más grande */
    width: 90%;
    margin: 0 auto;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.15rem;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 9999px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

#search-input::placeholder {
    color: #94a3b8;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); /* Leaf green shadow */
    transform: translateY(-2px);
}

.mentors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
    gap: 2rem;
}

.mentor-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column; /* Vertical layout */
    position: relative;
    height: 450px; /* Fixed height for consistency in 3-column grid */
}

.mentor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.mentor-photo-container {
    width: 100%;
    aspect-ratio: 10 / 7.5;
    flex-shrink: 0;
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.mentor-photo {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the 1/3 area */
}

.mentor-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: white;
}

/* Dynamic window (overlay) on hover */
.mentor-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 79, 79, 0.95); /* darkslategrey with transparency */
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10%);
    transition: all 0.3s ease;
    z-index: 10;
    overflow-y: auto;
}

.mentor-card:hover .mentor-details-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mentor-details-overlay h2 {
    color: white !important;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.mentor-details-overlay .description {
    color: #e2e8f0;
    font-size: 0.95rem;
}

.mentor-details-overlay .detailed-info,
.mentor-details-overlay .detailed-info span {
    color: white;
}

.mentor-details-overlay .detailed-info strong {
    color: var(--primary-color);
}

.mentor-details-overlay .keyword {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mentor-header {
    margin-bottom: 0.5rem;
}

.mentor-card h2 {
    font-size: 1.75rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

.institution {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
     flex-grow: 1;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.keyword {
    background-color: var(--keyword-bg);
    color: var(--keyword-text);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease;
}

.keyword:hover {
    background-color: var(--primary-color);
}

.publications {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: auto;
}

.publications h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.publications ul {
    list-style-type: none;
}

.publications li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.publications li::before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.detailed-info {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.sub-section {
    margin-bottom: 0.5rem;
}

.sub-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

.pub-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
}

.pub-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 4rem;
    background-color: var(--card-bg);
    border-radius: 1rem;
    border: 1px dashed var(--border-color);
}

@media (max-width: 900px) {
    .mentors-grid {
        grid-template-columns: 1fr;
    }
    
    .mentor-card {
        height: auto;
    }
    
    .container {
        padding: 2rem 1.5rem;
    }
    
    .mentor-card {
        flex-direction: column; /* Vertical on mobile */
    }
    
    .mentor-photo-container {
        width: 100%;
        height: auto;
        aspect-ratio: 10 / 7.5;
    }

    .mentor-content {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}