:root {
    --primary-blue: #111963;
    --primary-red: #c23030;
    --gold: gold;
    --text-dark: #333;
    --text-light: #f5f5f5;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.15);
    --card-hover-shadow: 0 15px 30px rgba(0,0,0,0.25);
}

/* Global Modernization - Override old wildcards */
*:not(i) {
    font-family: 'Roboto', sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .h2-first, .h2-first-n, .h2-first-t {
    font-family: 'Bebas Neue', cursive !important;
    letter-spacing: 1.5px;
}

/* Modern Cards */
.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    background-color: #fff;
    margin-bottom: 25px;
}

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

/* Special handling for directory cards */
.card-dir {
    padding: 20px !important;
    background: rgba(255, 255, 255, 0.98);
}

.card-dir img {
    border: 3px solid var(--primary-red);
    padding: 3px;
    transition: transform 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-dir:hover img {
    transform: scale(1.1);
    border-color: var(--primary-blue);
}

/* Modern Buttons */
.btn {
    border-radius: 50px !important;
    padding: 12px 30px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease !important;
    font-family: 'Roboto', sans-serif !important;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0,0,0,0.2);
}

/* Navbar Modernization */
.navbar {
    padding: 1rem 2rem !important;
    /* background-color: rgba(17, 25, 99, 0.95); We keep nav-blue from styles.css but can enhance it */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.navbar-brand {
    font-size: 2.2rem !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-link {
    font-family: 'Roboto', sans-serif !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

/* Hover underline effect */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #fff; /* White underline since nav is blue */
    transition: width .3s;
    margin: 5px auto 0;
}

.nav-link:hover::after {
    width: 80%;
}

/* Sections */
.masthead-heading {
    font-size: 4rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.4);
}

.masthead-subheading {
    font-family: 'Roboto', sans-serif !important;
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Footer Icons */
.footer-icon {
    font-size: 1.8rem !important;
    transition: transform 0.3s, color 0.3s;
}

.footer-icon:hover {
    color: var(--primary-red) !important;
    transform: scale(1.2);
}

/* Form Inputs */
input, textarea, select {
    border-radius: 8px !important;
    padding: 10px 15px !important;
    border: 1px solid #ddd !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(17, 25, 99, 0.2);
}

/* Typography Helpers */
.font-weight-light {
    font-weight: 300 !important;
}

.h2-first, .h2-first-n, .h2-first-t {
    font-size: 3rem; /* Make them bigger */
}

/* === MODALIDADES SECTION === */
.modality-card {
    position: relative;
    height: 450px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

/* Dark Gradient Overlay */
.modality-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.6) 50%,
        rgba(17, 25, 99, 0.9) 100%
    );
    opacity: 0.8;
    transition: opacity 0.4s ease, background 0.4s ease;
    z-index: 1;
}

.modality-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modality-card:hover::before {
    opacity: 1;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3) 0%,
        rgba(17, 25, 99, 0.95) 100%
    );
}

/* Content Wrapper */
.modality-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    color: white;
}

/* Title Styling */
.modality-title {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 20px; /* Initial margin from bottom */
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    transform: translateY(60px); 
    transition: transform 0.4s ease;
}

.modality-card:hover .modality-title {
    transform: translateY(0);
}

/* Details Hidden Initially */
.modality-details {
    max-height: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.modality-card:hover .modality-details {
    max-height: 300px; /* Allow expansion */
    opacity: 1;
    transform: translateY(0);
    margin-bottom: 20px;
}

.modality-details p {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.modality-details i {
    color: var(--gold);
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Button needs to appear too */
.modality-details .btn {
    margin-top: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s; /* Delay slightly */
}

.modality-card:hover .modality-details .btn {
    opacity: 1;
    transform: translateY(0);
}
