/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #2c5f7d;
    --primary-dark: #1e4158;
    --primary-light: #4a8bad;
    --secondary-color: #5da3a3;
    --accent-color: #7cb5a8;

    /* Colores de fondo */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-dark: #2d3748;

    /* Colores de texto */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --text-white: #ffffff;

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;

    /* Fuentes */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== ESTILOS GENERALES ===== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== HEADER Y NAVEGACIÓN ===== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition-normal);
}

.navbar {
    padding: var(--spacing-sm) 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.logo .subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition-normal);
}

.nav-link:hover {
    color: var(--primary-color);
}

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

/* Menu Toggle (Mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition-fast);
    border-radius: 2px;
}

/* ===== HERO SECTION ===== */
.hero {
    margin-top: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    padding: var(--spacing-xxl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    animation: fadeInUp 0.8s ease;
}

.hero-text {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
    animation: fadeInUp 1s ease;
}

/* ===== SECTIONS ===== */
.section {
    padding: var(--spacing-xxl) 0;
}

.section:nth-child(even) {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto var(--spacing-md);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SOBRE MI ===== */
.sobre-mi-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.profile-image {
    position: sticky;
    top: 120px;
}

.profile-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.profile-image img:hover {
    box-shadow: var(--shadow-xl);
    transform: scale(1.02);
}

.profile-text p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.credentials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.credential-item {
    background-color: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.credential-item h3 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credential-item p {
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
}

.credential-item .credential-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* ===== SERVICIOS ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background-color: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    text-align: center;
}

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

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.service-icon svg {
    width: 35px;
    height: 35px;
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== MODALIDADES ===== */
.modalidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.modalidad-item {
    background-color: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition-normal);
}

.modalidad-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.modalidad-item h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.modalidad-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== CURSOS ===== */
.cursos-content {
    max-width: 900px;
    margin: 0 auto;
}

.curso-destacado {
    background-color: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.curso-destacado h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
}

.curso-destacado > p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.curso-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.feature-item {
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.feature-item h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.curso-nota {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.95rem;
}

/* ===== FAQ ===== */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.faq-item {
    background-color: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border-top: 3px solid var(--primary-color);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.faq-item h3 {
    color: var(--primary-color);
    font-size: 1.15rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* ===== CONTACTO ===== */
.contacto-content {
    max-width: 800px;
    margin: 0 auto;
}

.contacto-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.info-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.info-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.info-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.info-icon svg {
    width: 25px;
    height: 25px;
}

.info-item h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.info-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-normal);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--bg-dark);
    color: var(--text-white);
    padding: var(--spacing-xl) 0;
}

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

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.footer-info p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-md);
}

.footer-legal {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.footer-legal p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.disclaimer {
    font-size: 0.8rem !important;
    font-style: italic;
}

.footer-badge {
    text-align: center;
    margin-top: var(--spacing-lg);
}

footer small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3a3a3a;
    border: 1px solid #505050;
    border-radius: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 0.875rem;
    font-weight: 500;
    color: #b3b3b3;
    transition: all 0.3s ease;
    white-space: nowrap;
}

footer small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: #606060;
}

footer small svg {
    flex-shrink: 0;
    opacity: 0.8;
}

footer small a {
    color: #e0e0e0;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

footer small a:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===== CHATBOT ===== */
#chatbot-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 998;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

#chatbot-toggle.open {
    transform: rotate(90deg);
}

#chatbot-window {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 350px;
    max-height: 500px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

#chatbot-close {
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

#chatbot-close:hover {
    transform: rotate(90deg);
}

#chatbot-messages {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.chatbot-message {
    display: flex;
    margin-bottom: var(--spacing-xs);
}

.chatbot-message-user {
    justify-content: flex-end;
}

.chatbot-message-bot {
    justify-content: flex-start;
}

.chatbot-message-content {
    max-width: 80%;
    padding: 0.75rem;
    border-radius: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.chatbot-message-user .chatbot-message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border-bottom-right-radius: 4px;
}

.chatbot-message-bot .chatbot-message-content {
    background: var(--bg-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chatbot-input-area {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    border-top: 1px solid var(--bg-light);
}

#chatbot-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--bg-light);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    resize: none;
    transition: var(--transition-fast);
}

#chatbot-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#chatbot-send {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

#chatbot-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Responsive chatbot */
@media (max-width: 480px) {
    #chatbot-window {
        right: 10px;
        bottom: 90px;
        width: calc(100vw - 20px);
        max-width: 350px;
    }
    
    #chatbot-toggle {
        right: 20px;
        bottom: 20px;
        width: 55px;
        height: 55px;
    }
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .sobre-mi-content {
        grid-template-columns: 1fr;
    }

    .profile-image {
        max-width: 300px;
        margin: 0 auto;
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-text {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section {
        padding: var(--spacing-xl) 0;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background-color: var(--bg-white);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
        gap: 0;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--bg-light);
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(10px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-10px);
    }

    .credentials {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .modalidades-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .curso-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

    .hero {
        padding: var(--spacing-xl) 0;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para navegación por teclado */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
