/* ==============================================
   KIUMAESTRO - ESTILOS PERSONALIZADOS
   Autor: KiuMaestro Dev Team
   Versión: 1.0.0
   ============================================== */

/* ============= VARIABLES DE COLOR ============= */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --success-color: #16a34a;
  --success-dark: #15803d;
  --warning-color: #f59e0b;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  --dark-color: #1f2937;
  --light-bg: #f9fafb;
  --border-color: #e5e7eb;
  --text-muted: #6b7280;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============= ESTILOS GLOBALES ============= */
html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--dark-color);
  line-height: 1.6;
  background-color: #ffffff;
  margin-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* ============= BRAND IDENTITY ============= */
.brand-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============= HERO SECTION ============= */
.hero-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

.hero-section::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"><rect fill="white" fill-opacity="0.05" width="100" height="100"/></svg>');
  opacity: 0.1;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  color: white;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-cta .btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

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

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item h3 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: white;
}

.stat-item p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

.hero-image {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* ============= PROBLEM/SOLUTION CARDS ============= */
.problem-solution-section {
  background-color: var(--light-bg);
}

.problem-card, .solution-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  height: 100%;
  transition: transform 0.3s ease;
}

.problem-card:hover, .solution-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.problem-card {
  border-left: 5px solid var(--danger-color);
}

.solution-card {
  border-left: 5px solid var(--success-color);
}

/* ============= HOW IT WORKS ============= */
.step-card {
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
}

.step-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-10px);
}

.step-number {
  position: absolute;
  top: -15px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
}

/* ============= CATEGORIES ============= */
.category-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.category-card:hover i {
  transform: scale(1.2);
}

.category-card i {
  transition: transform 0.3s ease;
}

/* ============= TESTIMONIALS ============= */
.testimonial-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  height: 100%;
  border-top: 4px solid var(--primary-color);
}

.stars {
  color: #fbbf24;
  font-size: 1.25rem;
}

/* ============= CTA FINAL ============= */
.cta-final-section {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  padding: 4rem 0;
}

/* ============= NOSOTROS PAGE ============= */
.nosotros-page {
  animation: fadeIn 0.8s ease-in;
}

.nosotros-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.nosotros-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"><rect fill="white" fill-opacity="0.05" width="100" height="100"/></svg>');
  opacity: 0.1;
}

.nosotros-hero h1 {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  color: white;
}

.nosotros-hero p {
  position: relative;
  z-index: 1;
}

.mision-section, .vision-section, .valores-section, .historia-section {
  padding: 4rem 0;
}

.mission-icon, .vision-icon {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.mission-text, .vision-text {
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.valor-card {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
  height: 100%;
  border-top: 4px solid var(--primary-color);
}

.valor-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-10px);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.valor-card i {
  font-size: 3rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.valor-card:hover i {
  transform: scale(1.1) rotate(5deg);
}

.valor-card h5 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.valor-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ============= COMO FUNCIONA PAGE ============= */
.comofunciona-page {
  animation: fadeIn 0.8s ease-in;
}

.comofunciona-hero {
  background: linear-gradient(135deg, #ff6b35 0%, #f59e0b 100%);
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.comofunciona-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 fill="white" fill-opacity="0.05" cx="50" cy="50" r="40"/></svg>');
  opacity: 0.15;
}

.comofunciona-hero h1 {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.comofunciona-hero p {
  position: relative;
  z-index: 1;
}

.proceso-section {
  padding: 4rem 0;
}

.proceso-card {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
  height: 100%;
  position: relative;
  border-bottom: 4px solid var(--primary-color);
}

.proceso-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-10px) scale(1.02);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(22, 163, 74, 0.05));
}

.proceso-icon {
  transition: transform 0.3s ease;
}

.proceso-card:hover .proceso-icon i {
  transform: scale(1.15) rotate(-5deg);
}

.proceso-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 4px solid white;
}

.proceso-card h4 {
  font-weight: 700;
  color: var(--dark-color);
}

.proceso-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.beneficios-section {
  padding: 4rem 0;
  background: linear-gradient(180deg, white 0%, var(--light-bg) 100%);
}

.beneficio-card {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  border: 2px solid transparent;
}

.beneficio-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02), rgba(245, 158, 11, 0.02));
}

.beneficio-card i {
  transition: transform 0.3s ease;
  display: block;
}

.beneficio-card:hover i {
  transform: scale(1.2);
}

.beneficio-card h5 {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

.beneficio-card p {
  margin: 0;
  line-height: 1.6;
}

/* ============= REGISTER/LOGIN FORMS ============= */
.register-container, .login-container {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
}

/* ============= SECTION TITLE (GLOBAL) ============= */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
  font-weight: 700;
}

.section-title i {
  margin-right: 0.5rem;
}

/* ============= REGISTER/LOGIN FORMS ============= */
.register-container, .login-container {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
}

.register-card, .login-card {
  background: white;
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
}

.user-type-selector {
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
}

.user-type-option {
  flex: 1;
}

.user-type-card {
  padding: 2rem 1.5rem;
  border: 3px solid var(--border-color);
  border-radius: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.user-type-option input[type="radio"]:checked + label .user-type-card {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(245, 158, 11, 0.1));
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  transform: scale(1.02);
}

.user-type-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.form-floating > label {
  color: var(--text-muted);
}

/* Animación suave para campos de maestro */
#maestroFields {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============= BUTTONS ============= */
.btn {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-success {
  color: var(--success-color);
  border-color: var(--success-color);
  background: white;
}

.btn-outline-success:hover {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

/* ============= NAVBAR ============= */
.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============= ANIMATIONS ============= */
.animate-fade-in {
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-stats {
    justify-content: center;
  }

  .user-type-selector {
    flex-direction: column;
  }

  .section-title {
    font-size: 2rem;
  }
  
  /* Optimización de tarjetas de trabajo para móviles */
  .trabajo-card,
  .trabajo-card-hover {
    margin-bottom: 1rem !important;
  }
  
  .trabajo-card .row,
  .trabajo-card-hover .row {
    flex-direction: column;
  }
  
  .trabajo-card .col-md-9,
  .trabajo-card-hover .col-md-9 {
    margin-bottom: 1rem;
  }
  
  .trabajo-card .col-md-3,
  .trabajo-card-hover .col-md-3 {
    text-align: center !important;
  }
  
  .trabajo-card .btn,
  .trabajo-card-hover .btn {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  /* Simplificar meta información en móviles */
  .trabajo-meta {
    flex-direction: column;
    gap: 0.5rem !important;
  }
  
  /* Ajustar descripción de trabajos en móviles */
  .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  /* Stack buttons verticalmente en móviles */
  .trabajo-card-hover .d-flex,
  .trabajo-card .d-flex {
    flex-direction: column !important;
  }
  
  /* Mejorar spacing en tarjetas */
  .card-body {
    padding: 1rem !important;
  }
  
  /* Hacer badges más pequeños en móviles */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Optimizar stat-card para móviles */
  .stat-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem !important;
  }
  
  .stat-icon {
    font-size: 2rem !important;
    margin-bottom: 0.5rem;
  }
  
  /* Mejorar formularios en móviles */
  .form-floating {
    margin-bottom: 0.75rem;
  }
  
  /* Optimizar navbar en móviles */
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
  
  /* Mejor visualización de postulaciones en móviles */
  .postulacion-meta {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  /* Hero section más compacto */
  .hero-section,
  .hero-construction {
    padding: 3rem 0 !important;
  }
  
  /* Footer más compacto */
  footer .row {
    text-align: center;
  }
  
  footer .col-md-3 {
    margin-bottom: 2rem;
  }
}

/* Responsive para pantallas muy pequeñas (<576px) */
@media (max-width: 576px) {
  /* Reducir padding general */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Títulos más pequeños */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  /* Botones más grandes para fácil toque */
  .btn {
    min-height: 44px;
    font-size: 1rem;
  }
  
  /* Tarjetas más compactas */
  .card {
    border-radius: 0.5rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
  
  /* Ocultar información secundaria en pantallas muy pequeñas */
  .d-none-xs {
    display: none !important;
  }
  
  /* Hacer iconos más pequeños */
  .fs-1 {
    font-size: 2rem !important;
  }
  
  .fs-2 {
    font-size: 1.5rem !important;
  }
  
  /* Simplificar user-type-card */
  .user-type-card {
    padding: 1rem !important;
    min-height: 150px !important;
  }
  
  /* Toast notifications más pequeñas */
  #toast-container {
    width: 100%;
    padding: 0.5rem !important;
  }
  
  .toast {
    max-width: 100%;
  }
}

/* Mejoras para tablets en orientación portrait */
@media (min-width: 769px) and (max-width: 991px) {
  .trabajo-card .col-md-9,
  .trabajo-card-hover .col-md-9 {
    flex: 0 0 70%;
    max-width: 70%;
  }
  
  .trabajo-card .col-md-3,
  .trabajo-card-hover .col-md-3 {
    flex: 0 0 30%;
    max-width: 30%;
  }
}

/* Optimización para modo paisaje en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section,
  .hero-construction {
    padding: 2rem 0 !important;
  }
  
  .modal-dialog {
    max-width: 90vw;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Aumentar área de toque para enlaces y botones */
  a,
  button,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Mejorar feedback visual en toque */
  .btn:active,
  .card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
  
  /* Eliminar hover effects en dispositivos táctiles */
  .trabajo-card-hover:hover,
  .stat-card:hover,
  .step-card:hover {
    transform: none;
  }
}

/* ============= UTILITIES ============= */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-light { background-color: var(--light-bg) !important; }

/* ============= FOOTER ============= */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: white;
}

/* ============= DASHBOARD STATS ============= */
.stat-card {
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 3rem;
  opacity: 0.9;
}

.stat-content h3 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat-content p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============= TRABAJO CARDS ============= */
.trabajo-card {
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.trabajo-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(5px);
}

.trabajo-card-hover {
  transition: all 0.3s ease;
}

.trabajo-card-hover:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.trabajo-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ============= MAESTRO AVATAR ============= */
.maestro-avatar {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  color: white;
}

/* ============= POSTULACION META ============= */
.postulacion-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============= WHATSAPP BUTTON ANIMATION ============= */
.btn-success[href*="wa.me"] {
  animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============= FORMS ENHANCEMENT ============= */
.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

/* ============= TABLE RESPONSIVE ============= */
.table-hover tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.05);
}
