/* Variables CSS para modo claro y oscuro */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5faff;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-accent: #2366C4;
    --border-primary: #000000;
    --border-secondary: #cccccc;
    --border-hover: #4F8CFF;
    --shadow-light: rgba(35, 102, 196, 0.13);
    --shadow-medium: rgba(35, 102, 196, 0.33);
    --icon-opacity: 0.1;
    --card-hover-bg: rgba(245, 250, 255, 0.8);
    --modal-backdrop: rgba(35, 102, 196, 0.13);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #1e2a3a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-accent: #4F8CFF;
    --border-primary: #444444;
    --border-secondary: #555555;
    --border-hover: #4F8CFF;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --icon-opacity: 0.05;
    --card-hover-bg: rgba(79, 140, 255, 0.1);
    --modal-backdrop: rgba(0, 0, 0, 0.5);
}

/* Reset y tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* Fondo con iconos */
.icon-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: var(--icon-opacity);
    transition: opacity 0.3s ease;
}

/* Ventana principal - CORREGIDO */
.window {
    background: var(--bg-primary);
    z-index: 1;
    position: relative;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    margin: 20px auto;
    width: 100%;
    max-width: 1200px; /* Ancho máximo definido */
    min-width: 320px;  /* Ancho mínimo para móviles */
    transition: all 0.3s ease;
}

/* Barra de título */
.title-bar {
    background: var(--bg-primary);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 35px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.window-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
    transition: color 0.3s ease;
}

.window-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Botón de alternancia de tema */
.theme-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary, #ffffff);
    border: 2px solid var(--border-primary, #e1e8ed);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light, rgba(0, 0, 0, 0.1));
    z-index: 1000;
}

.theme-toggle-fixed:hover {
    background: var(--card-hover-bg, #f8f9fa);
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-medium, rgba(0, 0, 0, 0.15));
}

.theme-toggle-fixed .theme-icon {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] .theme-toggle-fixed .theme-icon {
    transform: scale(1.2);
}

[data-theme="dark"] .theme-toggle-fixed {
    background: var(--bg-secondary, #2d2d2d);
    border-color: var(--border-primary, #404040);
}

[data-theme="dark"] .theme-toggle-fixed:hover {
    background: var(--card-hover-bg, #3a3a3a);
}

[data-theme="dark"] .theme-toggle-fixed .theme-icon {
    color: var(--text-primary, #ffffff);
    transform: rotate(180deg);
}

.theme-toggle-fixed:active {
    transform: scale(0.95);
}

.control {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.control:hover {
    transform: scale(1.1);
}
.minimize { background-color: #FFE600; }
.maximize { background-color: #FFA500; }
.close { background-color: #FF0000; }

/* Hero */
.hero-section {
    padding: 32px 24px;
    background-color: var(--bg-primary);
    text-align: center;
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}
.hero-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.hero-subtitle {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
    transition: color 0.3s ease;
}

/* Sobre Nosotros */
.about-section {
    padding: 32px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}
.about-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.about-content {
    max-width: 700px;
    margin: 0 auto;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    text-align: center;
    transition: color 0.3s ease;
}

/* Características - CORREGIDO */
.features-section {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Aumentado el minmax */
    gap: 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
    justify-items: center; /* Centrar las tarjetas */
}
.features-section h2 {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
    grid-column: 1 / -1;
}

/* Efectos de tarjetas - NUEVOS ESTILOS */
.feature-card, .role-card, .testimonial-card, .tech-item {
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

/* Estilos para el tema claro */
.feature-card.card-clicked, 
.role-card.card-clicked, 
.testimonial-card.card-clicked, 
.tech-item.card-clicked {
    box-shadow: 0 0 0 4px #2366c455, 0 8px 18px #2366c455;
    background: #e3f2ff;
    border: 1px solid #2366C4;
    transform: translateY(-2px) scale(1.01);
}

/* Estilos para el tema oscuro */
[data-theme="dark"] .feature-card.card-clicked,
[data-theme="dark"] .role-card.card-clicked,
[data-theme="dark"] .testimonial-card.card-clicked,
[data-theme="dark"] .tech-item.card-clicked {
    box-shadow: 0 0 0 4px #4F8CFF55, 0 8px 18px #4F8CFF55;
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid #4F8CFF;
}

.feature-card {
    background-color: var(--bg-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: 4px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    width: 100%; /* Asegurar que ocupe todo el espacio disponible */
    max-width: 350px; /* Límite máximo de ancho */
}

/* Opcional: efecto hover para mejor UX */
.feature-card:hover, 
.role-card:hover, 
.testimonial-card:hover, 
.tech-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .feature-card:hover,
[data-theme="dark"] .role-card:hover,
[data-theme="dark"] .testimonial-card:hover,
[data-theme="dark"] .tech-item:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.material-icons {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
    transition: color 0.3s ease;
}
.feature-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.feature-description {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}
.feature-list {
    list-style: none;
    margin-top: 12px;
}
.feature-list li {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-primary);
    padding-left: 20px;
    position: relative;
    transition: color 0.3s ease;
}

/* Perfiles de Usuario - CORREGIDO */
.roles-section {
    padding: 32px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}
.roles-section h2 {
    font-size: 20px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Aumentado el minmax */
    gap: 20px;
    justify-items: center; /* Centrar las tarjetas */
}
.role-card {
    background-color: var(--bg-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: 4px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    width: 100%; /* Asegurar que ocupe todo el espacio disponible */
    max-width: 300px; /* Límite máximo de ancho */
}
.role-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.role-card ul {
    list-style: none;
}
.role-card ul li {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.role-card-student {
    border: 2px solid var(--text-accent) !important;
    background-color: var(--bg-tertiary);
}
.role-card-student h3 {
    color: var(--text-accent);
}

/* Testimonios */
.testimonials-section {
    padding: 32px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}
.testimonials-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.testimonials-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Aumentado el minmax */
    gap: 20px;
    margin-top: 24px;
    justify-items: center; /* Centrar las tarjetas */
}
.testimonial-card {
    background-color: var(--bg-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: 4px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
    width: 100%; /* Asegurar que ocupe todo el espacio disponible */
    max-width: 320px; /* Límite máximo de ancho */
}
.testimonial-author {
    margin-top: 12px;
    font-weight: 600;
    color: var(--text-accent);
    font-size: 13px;
    transition: color 0.3s ease;
}

/* Tecnologías */
.tech-section {
    padding: 32px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}
.tech-section h2 {
    font-size: 20px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    text-align: center;
    justify-items: center; /* Centrar las tarjetas */
}
.tech-item {
    background-color: var(--bg-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: 4px;
    padding: 10px;
    position: relative;
    overflow: hidden;
    width: 80%; /* Asegurar que ocupe todo el espacio disponible */
    max-width: 250px; /* Límite máximo de ancho */
}
.tech-item h4 {
    font-size: 14px;
    margin-top: 8px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Llamada a la acción */
.cta-section {
    padding: 32px 24px;
    background-color: var(--bg-primary);
    text-align: center;
    transition: all 0.3s ease;
}
.cta-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    transition: color 0.3s ease;
}
.cta-button {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 24px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.cta-button:hover {
    background-color: var(--card-hover-bg);
    box-shadow: 0 4px 20px var(--shadow-light);
}

/* Footer */
.footer {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 16px 24px;
    transition: all 0.3s ease;
}
.footer a {
    color: var(--text-accent);
    text-decoration: none;
    margin: 0 8px;
    font-weight: 500;
    transition: color 0.3s ease;
}
.footer a:hover {
    text-decoration: underline;
}

/* Animaciones */
.window-minimize-animation {
    transform: translateY(40px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.window-maximize-animation {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 1000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.window-close-animation {
    transform: scale(0.9);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Botón central genérico para restaurar/reabrir */
.centered-quork-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 4px 18px var(--shadow-light);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    padding: 18px 32px;
    z-index: 1001;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    animation: popIn 0.5s;
}
.centered-quork-button img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 8px;
    transition: transform 0.3s;
}
.centered-quork-button:hover {
    background: var(--card-hover-bg);
    box-shadow: 0 8px 32px var(--shadow-medium);
    transform: translate(-50%, -50%) scale(1.06) rotate(-2deg);
}
.centered-quork-button:hover img {
    transform: rotate(10deg) scale(1.1);
}

/* Botón SOLO ICONO para reabrir (cerrar) */
.centered-quork-icon-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-light);
    padding: 0;
    z-index: 1002;
    cursor: pointer;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: popIn 0.5s;
}
.centered-quork-icon-button img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    transition: transform 0.3s;
}
.centered-quork-icon-button:hover {
    background: var(--card-hover-bg);
    box-shadow: 0 12px 48px var(--shadow-medium);
    transform: translate(-50%, -50%) scale(1.10) rotate(2deg);
}
.centered-quork-icon-button:hover img {
    transform: rotate(-8deg) scale(1.13);
}

.custom-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-backdrop);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.custom-modal.show {
    display: flex;
}

.custom-modal-content {
    background: var(--bg-primary);
    border: 2px solid var(--text-accent);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow-medium);
    padding: 32px 32px 24px 32px;
    text-align: center;
    min-width: 280px;
    animation: popIn 0.4s;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.custom-modal-icon {
    font-size: 44px;
    color: var(--text-accent);
    margin-bottom: 16px;
    display: block;
    transition: color 0.3s ease;
}

@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Responsive - MEJORADO */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .window {
        margin: 10px auto;
        min-width: 300px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .features-section {
        grid-template-columns: 1fr;
        padding: 20px 15px;
    }
    
    .feature-card {
        max-width: none; /* Permitir ancho completo en móvil */
    }
    
    .roles-grid {
        grid-template-columns: 1fr;
    }
    
    .role-card {
        max-width: none; /* Permitir ancho completo en móvil */
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-section,
    .testimonials-section,
    .contact-section,
    .footer {
        padding: 20px 15px;
    }
    
    .testimonials-list {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        max-width: none; /* Permitir ancho completo en móvil */
    }
    
    .theme-toggle-fixed {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-section,
    .about-section,
    .roles-section,
    .testimonials-section,
    .tech-section,
    .cta-section {
        padding: 20px 10px;
    }
    
    .features-section {
        padding: 20px 10px;
    }
}