:root {
    --primary-color: #1a237e;
    /* Deep Indigo */
    --secondary-color: #0d47a1;
    /* Dark Blue */
    --accent-color: #ffd700;
    /* Gold */
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --font-main: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --transition-speed: 0.3s;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    transition: color var(--transition-speed);
    text-decoration: none;
}

a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Navbar Overrides */
/* Navbar Overrides */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    padding: 1rem 2rem;
    transition: all 0.4s ease;
    border: 0;
    border-radius: 0;
}

.navbar.navbar-transparent {
    background: transparent !important;
    box-shadow: none;
    padding-top: 25px;
}

.navbar.navbar-scrolled {
    background-color: var(--primary-color) !important;
    /* Fallback */
    background: linear-gradient(135deg, var(--primary-color), #4527a0) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 1rem 2rem;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .nav-link i {
    color: #ffffff !important;
    font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:hover i {
    color: var(--accent-color) !important;
}

.navbar .navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-profile-img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar .navbar-toggler .navbar-toggler-icon {
    background-color: #ffffff !important;
}

/* Hero Section */
.page-header {
    height: 60vh;
    min-height: 400px;
    background-position: center;
    background-size: cover;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(26, 35, 126, 0.3), rgba(26, 35, 126, 0.1));
}

/* Profile Section */
.main-raised {
    margin: -60px 30px 0;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(180deg, #ffffff 0%, #dcdfe9 100%);
    position: relative;
    z-index: 10;
    padding-bottom: 50px;
}

.profile-content .avatar {
    margin-top: -80px;
    text-align: center;
}

.profile-content .avatar img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.profile-content .name {
    text-align: center;
    margin-top: 20px;
}

.profile-content .name h3 {
    margin-bottom: 5px;
}

.profile-content .name p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Tabs */
.profile-tabs {
    margin-top: 40px;
}

.nav-pills .nav-item .nav-link {
    background-color: transparent;
    color: var(--text-light);
    font-weight: 600;
    border-radius: 30px;
    padding: 10px 20px;
    transition: all var(--transition-speed);
}

.nav-pills .nav-item .nav-link.active,
.nav-pills .nav-item .nav-link:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* Content Sections */
.tab-content {
    padding: 20px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-color);
    display: inline-block;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent-color);
}

/* Cards (Publications & Videos) */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    background: rgba(255, 255, 255, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(5px);
    margin-bottom: 30px;
    /* overflow: hidden; Removed to prevent clipping */
    height: auto;
    /* Let it grow */
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Specific selector to override material kit */
.main-raised .card .card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    font-weight: 600;
    color: var(--primary-color);
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    display: block !important;
    flex: 0 0 auto !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Target the h4 we added in rows.php */
.main-raised .card .card-header h4.card-title,
.main-raised .card .card-header h4 {
    font-size: 0.9rem !important;
    /* Reduced from 1rem */
    line-height: 1.4 !important;
    margin: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    color: var(--primary-color);
    font-weight: 700;
    word-wrap: break-word !important;
    word-break: break-word !important;
    display: block !important;
    height: auto !important;
}

.card-body {
    padding: 20px;
    color: var(--text-color);
    flex: 1 1 auto;
}

.card .texto {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center content horizontally */
}

.card .texto i {
    margin-right: 8px;
    font-size: 1.3rem;
    line-height: 1;
}

.card .texto_inferior {
    color: var(--text-light);
    font-size: 0.95rem;
    display: block;
    line-height: 1.5;
}

/* Contact Form */
/* Contact Form */
.contact-section {
    background: linear-gradient(135deg, #3949ab 0%, #7986cb 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 20px;
    margin-top: 60px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Decorative background elements */
.contact-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.contact-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.contact-form {
    position: relative;
    z-index: 1;
}

.contact-form .form-group {
    margin-bottom: 2rem;
    position: relative;
}

.contact-form .form-control {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 0;
    color: white;
    padding: 15px 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: none;
    height: auto;
}

.contact-form .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--accent-color);
    outline: none;
    box-shadow: none;
}

/* Floating Label Styles */
.floating-label {
    position: absolute;
    top: 15px;
    left: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 300;
    pointer-events: none;
    transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: top left;
}

.contact-form .form-control:focus~.floating-label,
.contact-form .form-control:not(:placeholder-shown)~.floating-label {
    transform: translateY(-25px) scale(0.85);
    color: var(--accent-color);
    font-weight: 500;
    left: 0;
    /* Align left cleanly */
}

/* Hide default placeholders since we use labels */
.contact-form .form-control::placeholder {
    color: transparent;
}

.contact-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Button Styling */
#btnEnviar {
    background: white !important;
    color: var(--primary-color) !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 18px 50px;
    border-radius: 50px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: auto;
    min-width: 250px;
    margin-top: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
}

#btnEnviar:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--accent-color) !important;
    color: var(--primary-color) !important;
}

#btnEnviar:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

#btnEnviar i {
    transition: transform 0.3s ease;
}

#btnEnviar:hover i {
    transform: translateX(5px) rotate(-10deg);
}

/* Loading/Success States */
.envia {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: center;
}

#success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer a {
    color: white;
    font-weight: 500;
}

.footer a:hover {
    color: var(--accent-color);
}

.footer .copyright {
    float: none !important;
    /* Override Bootstrap */
}

.footer nav {
    float: none !important;
    /* Override Bootstrap */
}

@media (max-width: 768px) {
    .footer .container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

/* Utilities */
.text-justify {
    text-align: justify;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-raised {
        margin-left: 10px;
        margin-right: 10px;
    }

    .profile-content .avatar img {
        width: 120px;
        height: 120px;
    }
}