/**
 * ProgramarGratis v2.0 - Estilos Principales
 * Tema: Dark con acentos verdes neón
 */

/* =====================================================
   VARIABLES CSS
   ===================================================== */
:root {
    /* Colores principales */
    --primary: #00ff88;
    --primary-dark: #00cc6a;
    --primary-light: #66ffb3;
    --secondary: #00a8ff;
    --secondary-dark: #0086cc;
    
    /* Colores de fondo */
    --bg-dark: #0a0a0a;
    --bg-light: #111111;
    --bg-lighter: #1a1a1a;
    --bg-card: #161616;
    
    /* Colores de texto */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --text-dark: #333333;
    
    /* Estados */
    --success: #00ff88;
    --error: #ff4444;
    --warning: #ffaa00;
    --info: #00a8ff;
    
    /* Bordes */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(0, 255, 136, 0.5);
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.5);
    
    /* Tipografía */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-code: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    
    /* Tamaños */
    --nav-height: 64px;
    --sidebar-width: 260px;
    --border-radius: 8px;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Gradientes */
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-dark: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
}

/* =====================================================
   RESET Y BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix para colores de botones con alta especificidad */
body .btn-primary,
body a.btn-primary {
    color: #000000 !important;
}

body .btn-primary:hover,
body a.btn-primary:hover,
body .btn-primary:focus,
body a.btn-primary:focus {
    color: #000000 !important;
}

body .btn-outline,
body a.btn-outline {
    color: #00ff88 !important;
}

body .btn-outline:hover,
body a.btn-outline:hover,
body .btn-outline:focus,
body a.btn-outline:focus {
    color: #000000 !important;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Los botones como enlaces no deben heredar estilos de enlaces */
a.btn {
    text-decoration: none !important;
}

a.btn:hover {
    text-decoration: none !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Párrafos y listas */
p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Code */
code {
    font-family: var(--font-code);
    background: var(--bg-lighter);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--primary);
}

pre {
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* =====================================================
   UTILIDADES
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* =====================================================
   COMPONENTES - BOTONES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

/* Botón primario - MEJORADO PARA CONTRASTE */
.btn-primary {
    background: var(--gradient);
    color: #000000 !important; /* Negro puro para máximo contraste */
    border-color: transparent;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-primary:hover {
    background: var(--gradient);
    color: #000000 !important; /* Negro puro en hover también */
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-primary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

/* Botón outline - MEJORADO PARA CONTRASTE */
.btn-outline {
    background: transparent;
    color: var(--primary) !important; /* Verde brillante */
    border-color: var(--primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.btn-outline:hover {
    color: #000000 !important; /* Negro puro para máximo contraste sobre fondo verde */
    border-color: var(--primary);
}

.btn-outline:hover::before {
    transform: scaleX(1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   COMPONENTES - FORMULARIOS
   ===================================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: var(--bg-lighter);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Checkbox y Radio */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Form validation */
.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-valid {
    border-color: var(--success);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--error);
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--success);
}

/* =====================================================
   COMPONENTES - CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-lighter);
    border-top: 1px solid var(--border-color);
}

/* Course Card */
.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}

.course-header {
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.course-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.course-level {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.course-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* =====================================================
   COMPONENTES - ALERTAS
   ===================================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border-color: var(--success);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
    border-color: var(--error);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
    border-color: var(--warning);
}

.alert-info {
    background: rgba(0, 168, 255, 0.1);
    color: var(--info);
    border-color: var(--info);
}

/* =====================================================
   COMPONENTES - BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.badge-secondary {
    background: var(--secondary);
    color: var(--text-primary);
}

.badge-success {
    background: var(--success);
    color: var(--bg-dark);
}

.badge-error {
    background: var(--error);
    color: var(--text-primary);
}

/* =====================================================
   COMPONENTES - PROGRESS
   ===================================================== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-lighter);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--gradient);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* =====================================================
   COMPONENTES - MODALS
   ===================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   LAYOUT - NAVIGATION
   ===================================================== */
header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(17, 17, 17, 0.9);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: var(--nav-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Ajustes específicos para botones en el nav */
.nav-links .btn {
    text-decoration: none;
}

.nav-links .btn:hover {
    text-decoration: none;
}

/* Asegurar colores correctos en botones del nav */
.nav-links .btn-primary {
    color: #000000 !important;
}

.nav-links .btn-primary:hover {
    color: #000000 !important;
}

.nav-links .btn-outline {
    color: var(--primary) !important;
}

.nav-links .btn-outline:hover {
    color: #000000 !important;
}

/* =====================================================
   LAYOUT - FOOTER
   ===================================================== */
footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.social-links a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* =====================================================
   SECCIONES
   ===================================================== */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

/* Task Box */
.task-box {
    background: var(--bg-lighter);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.task-box h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a:not(.btn) {
        display: none;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Grid adjustments */
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* =====================================================
   ANIMACIONES
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease;
}

.animate-slideIn {
    animation: slideIn 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}

/* =====================================================
   SCROLLBAR PERSONALIZADA
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    header, footer, .no-print {
        display: none;
    }
}