:root {
    /* Color Inversion: Blue becomes White, White becomes Blue */
    --primary-color: #ffffff;
    --primary-dark: #f0f0f0;
    --accent-color: #5eabdc;
    --text-color: #ffffff;
    --bg-color: #5eabdc;
    --white: #5eabdc; 
    --gray-light: rgba(255, 255, 255, 0.2);
    --gray-dark: #f8f9fa;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

header {
    background: var(--accent-color);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.lang-selector {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 1.5rem;
}

.lang-selector a {
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 4px;
}

.lang-selector a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.nav-links a {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Hero Section with Video fix */
.hero {
    position: relative;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff; /* Text color changed to white as requested */
    text-align: center;
    padding: 2rem;
    overflow: hidden;
    background: white; /* This will be the bottom layer */
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.8; 
    z-index: 1; /* Above background */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Darker overlay to make white text pop */
    z-index: 2; /* Above video */
}

.hero h1, .hero p {
    position: relative;
    z-index: 10; /* Above everything */
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5); /* Shadow for readability */
}

/* Rest of the styles... */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

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

.news-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.news-img {
    height: 200px;
    background-color: rgba(255, 255, 255, 0.2);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-date {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: block;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.news-excerpt {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-more {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--primary-color);
    color: #5eabdc;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: auto;
    text-align: center;
}

footer {
    background: rgba(0, 0, 0, 0.1);
    color: var(--white);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-col h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Backoffice */
.admin-header {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    border: none;
}

.btn-primary { background: var(--primary-color); color: #5eabdc; }
.btn-danger { background: #ff5e5e; color: white; }
.btn-success { background: #45f18e; color: #1e4d31; }

.news-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Backoffice Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary-color);
    color: #5eabdc;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.form-group label {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: none;
}

/* Subjects and Teachers Grid Styles */
.subjects-grid, .profesorado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.subject-item, .teacher-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.subject-item:hover, .teacher-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.subject-name, .teacher-name {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.teacher-subject {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.tutoring {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tutoring-title {
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.tutoring-list {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.profesorado-list {
    list-style: none;
    padding: 0;
}

.profesorado-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
}

.profesorado-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    .lang-selector {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 0.5rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .news-form-grid {
        grid-template-columns: 1fr;
    }
    .admin-tabs {
        flex-wrap: wrap;
    }
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    .nav-links {
        gap: 0.5rem;
    }
    .nav-links a {
        font-size: 0.8rem;
    }
    .admin-card {
        padding: 1.5rem 1rem;
    }
    .tab-btn {
        width: 100%;
    }
}
