/* ======= Global Variables ======= */ 

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

:root {
    /* --base-color: #fff;
    --base-variant: #e8e9ed;
    --text-color: #111528;
    --secondary-text: #232738;
    --primary-color: #3a435d;
    --accent-color: #0071ff; */
    --primary-color: rgb(70, 130, 180);
    --secondary-color: 	#FF6F61;
    --text-color: #333;
    --bg-color: #fff;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --transition: all 0.3s ease;
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #34495e;
    --success: #2ecc71;
    --warning: #f39c12;
    --info: #1abc9c;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    font-size: 15px;
}

/* ======= Dark Mode Switch ======= */

.darkmode {
    /* --base-color: #070b1d;
    --base-variant: #101425;
    --text-color: #fff;
    --secondary-text: #a4a5b8;
    --primary-color: #7082b9;
    --accent-color: #0071ff; */
    --text-color: #fff;
    --primary-color: #7082b9;
    --secondary-text: #a4a5b8;
    --bg-color: #2c3e50;
    --nav-bg: rgba(44, 62, 80, 0.95);
}

#theme-switch {
    height: 40px;
    width: 40px;
    padding: 0;
    border-radius: 50%;
    background-color: var(--base-variant);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 10px;
    right: 10px;
}

#theme-switch svg {
    fill: var(--primary-color);
}

#theme-switch svg:last-child {
    display: none;
}

.darkmode #theme-switch svg:first-child {
    display: none;
}

.darkmode #theme-switch svg:last-child {
    display: block;
}

/* ======= Dark Mode Toggle ======= */

.theme-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
}

/* ======= Navigation ======= */

.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    padding: 1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    padding: 0.5rem;
}

.nav-list a:link {
    color: var(--text-color);
}

.nav-list a:visited {
    color: var(--text-color);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ======= Sections ======= */

section {
    min-height: 100vh;
    padding: 4rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.responsive-container{
    position: static;
    overflow: hidden;
    text-align: center;
    width: 100%;
    height: 900px;
    border: none;
    background-color: var(--base-color);
}

/* ======= Project Cards ======= */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
}

.project-grid ul {
    list-style-type:none;
}

.project-card {
    background: var(--nav-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    max-width: 250px;
    margin: 10px;
}

h2 {
    filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.7));
    margin-bottom: 10px;
}

.equation {
    align-content: center;
    margin: 10px;
    height: 60px;
}

/* ======= About Section ======= */

.about-container {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.about-image img {
    width: 100%;
    border-radius: 15px;
    filter: drop-shadow(20px -6px 6px rgba(0,0,0,0.7));
}

.about-content {
    flex: 1;
    text-align: left;
}

.cv-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cv-buttons a:link {
    color: var(--text-color);
}

.cv-buttons a:visited {
    color: var(--text-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1rem;
    background: var(--secondary);
    color: var(--text-color);
    border-radius: 30px;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-secondary {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgb(95, 138, 173);
}

.thesis-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.thesis-buttons a:link {
    color: var(--text-color);
}

.thesis-buttons a:visited {
    color: var(--text-color);
}

/* ======= Teaching Section ======= */

.project-card-cover {
    display: flex;
    background: var(--nav-bg);
    padding: 1.5rem;
    margin-top: auto;
    margin-bottom: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.project-card-cover:hover {
    transform: translateY(-5px);
}

.content {
    margin: auto;
}

.cover img {
    width: 50%;
    float: right;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* ======= Social Links ======= */

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3.5rem;
    flex-wrap: wrap;
    margin-bottom: -15px;
}

.social-links a:link{
    color: var(--text-color);
}

.social-links a:visited{
    color: var(--text-color);
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.icon {
    width: 2.5em;
    height: 2.5em;
    font-size: 2em;
    display: flex;
    text-decoration: none;
    color: #000;
    outline: 2px solid #000;
    outline-offset: -8px;
    border-radius: 50%;
    transition: all 200ms ease-in;
}

.icon i {
    margin: auto;
}

.icon:hover {
    outline-width: 6px;
    outline-color: #fff;
    color: #fff;
}

.icon:hover:has(.fa-x-twitter) {
    background-color: #000;
}

.icon:hover:has(.fa-instagram) {
    background-image: radial-gradient(
        circle at 30% 107%,
        #fdf497 0%,
        #fdf497 5%,
        #fd5949 45%,
        #d6249f 60%,
        #285aeb 90%
    );
}

.icon:hover:has(.fa-github) {
    background-color: #000;
}

.icon:hover:has(.fa-spotify) {
    background-color: green;
}

.icon:hover:has(.fa-linkedin) {
    background-color: blue;
}

/* ======= Links ======= */

a:link{
    color: var(--secondary-color);
    text-decoration: none;
}

a:visited {
    color: var(--secondary-color);
    background-color: transparent;
    text-decoration: none;
}

a:hover {
    opacity: 1;
}

/* ======= Footer ======= */

footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px 0px 10px 0px;
position: static;
bottom: 0;
width: 100%;
}

/* ======= Mobile View ======= */

@media (max-width: 768px) {

    .section {
        scroll-margin-top: 3.5rem;
        padding: 1rem 1rem 1rem; 
    }

    .nav-list {
        display: none;
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        padding: 1rem;
        text-align: center;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-list.active {
        display: inline-grid;
        gap: 1rem;
        border-bottom: 0px solid var(--primary-color);
    }

    .menu-toggle {
        display: block;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-content {
        text-align: center;
    }

    .cv-buttons {
        justify-content: center;
    }

    .about-image {
        max-width: 300px;
    }

    .levels-container {
        flex-direction: column;
    }
    
    .quote {
        font-size: 1.6rem;
    }
    
    .subject-title {
        font-size: 2rem;
    }
}

.container {
    max-width: 1200px;
    margin: -20px auto;
    padding: 20px;
}

/* Estilo para la frase célebre */
.quote-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: white;
    padding: 50px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.2rem;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.5;
    position: relative;
}

.quote::before, .quote::after {
    font-size: 4rem;
    color: rgba(255,255,255,0.2);
    position: absolute;
}

.quote::before {
    top: -30px;
    left: -40px;
}

.quote::after {
    bottom: -70px;
    right: -40px;
}

.author {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    margin-top: 25px;
    font-style: normal;
    font-weight: 600;
    color: var(--secondary);
}

/* Estilos para las secciones de asignaturas */
.subject-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 40px;
    margin-left: -30px;
    margin-right: -30px;
    transition: transform 0.3s ease;
}

.subject-section:hover {
    transform: translateY(-5px);
}

.subject-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary);
    display: flex;
    align-items: center;
}

.subject-title i {
    margin-right: 15px;
    color: var(--accent);
}

/* Estilos para los niveles de bachillerato */
.levels-container {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.level-card {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.level-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--secondary);
}

/* Estilos para las categorías (apuntes, deberes, etc.) */
.category {
    margin-bottom: 25px;
}

.category-title {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.category-title i {
    margin-right: 10px;
}

.units-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.unit {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.unit:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

.unit-number {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.unit-name {
    font-size: 0.85rem;
    color: var(--dark);
    hyphens: auto;
}

/* Estilos para recursos */
.resources {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.resource {
    background: white;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

.resource:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.resource i {
    font-size: 1.5rem;
    margin-right: 12px;
    color: var(--secondary);
}

.resource-text h4 {
    font-size: 1.1rem;
    color: var(--dark);
}

.resource-text p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.home-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse 2s infinite;
}

.home-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #fad0c4, #ff9a9e);
}

.home-button i {
    font-size: 30px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}