/* ============================================
   PERFILES DEL SISTEMA - ESTILOS
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #1e293b;
  background: #f8fafc;
  overflow-x: hidden;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  animation: float 10s ease-in-out infinite reverse;
}

.hero-content {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

.hero-icon {
  font-size: 4rem;
  color: white;
  margin-bottom: 1.5rem;
  animation: scaleIn 0.6s ease-out 0.2s backwards;
}

.hero-icon i {
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: slideInDown 0.8s ease-out;
}

.hero p {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.95);
  max-width: 600px;
  margin: 0 auto;
  animation: fadeIn 1s ease-out 0.4s backwards;
}

/* ============================================
   SELECTOR DE PERFILES
   ============================================ */
.profile-selector {
  background: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.6s ease-out;
}

.selector-wrapper {
  max-width: 500px;
  margin: 0 auto;
}

.selector-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.8rem;
  text-align: center;
}

.selector-label i {
  color: #06b6d4;
  margin-right: 0.5rem;
}

.profile-select {
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-select:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
  outline: none;
}

.profile-select:hover {
  border-color: #06b6d4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* ============================================
   PROFILE CARDS
   ============================================ */
.profiles-content {
  min-height: 60vh;
}

.profile-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  display: none;
  animation: fadeInScale 0.5s ease-out;
}

.profile-card.active {
  display: block;
}

/* Profile Header */
.profile-header {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  padding: 2.5rem 2rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.profile-header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.profile-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  animation: bounceIn 0.6s ease-out;
}

.profile-icon.administrativo {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(124, 58, 237, 0.9));
}

.profile-icon.recepcionista {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
}

.profile-icon.paciente {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
}

.profile-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.profile-subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  margin: 0;
}

.profile-badge {
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: slideInRight 0.6s ease-out 0.3s backwards;
  position: relative;
  z-index: 1;
}

.profile-badge i {
  font-size: 1.1rem;
}

.profile-badge.administrativo {
  background: rgba(139, 92, 246, 0.25);
}

.profile-badge.recepcionista {
  background: rgba(16, 185, 129, 0.25);
}

.profile-badge.paciente {
  background: rgba(245, 158, 11, 0.25);
}

/* Profile Body */
.profile-body {
  padding: 3rem 2rem;
}

/* Profile Image */
.profile-image {
  width: 100%;
  max-width: 600px;
  height: 350px;
  margin: 0 auto 3rem;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: zoomIn 0.6s ease-out 0.2s backwards;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.profile-image:hover img {
  transform: scale(1.1);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.7), rgba(8, 145, 178, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.profile-image:hover .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 4rem;
  color: white;
  animation: rotateIn 0.5s ease-out;
}

/* Profile Description */
.profile-description {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 3rem;
  border-left: 5px solid #06b6d4;
  animation: slideInLeft 0.6s ease-out 0.3s backwards;
}

.profile-description h3 {
  color: #06b6d4;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-description p {
  color: #475569;
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0;
}

/* Permissions Grid */
.permissions-grid {
  margin-bottom: 3rem;
}

.permissions-grid > h3 {
  color: #1e293b;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  animation: fadeIn 0.6s ease-out 0.4s backwards;
}

.permissions-grid > h3 i {
  color: #06b6d4;
}

.permission-item {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  gap: 1.3rem;
  animation: fadeInUp 0.5s ease-out backwards;
}

.permission-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(6, 182, 212, 0.15);
  border-color: #06b6d4;
}

.col-md-6:nth-child(1) .permission-item { animation-delay: 0.1s; }
.col-md-6:nth-child(2) .permission-item { animation-delay: 0.2s; }
.col-md-6:nth-child(3) .permission-item { animation-delay: 0.3s; }
.col-md-6:nth-child(4) .permission-item { animation-delay: 0.4s; }
.col-md-6:nth-child(5) .permission-item { animation-delay: 0.5s; }
.col-md-6:nth-child(6) .permission-item { animation-delay: 0.6s; }

.permission-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
  transition: transform 0.3s ease;
}

.permission-item:hover .permission-icon {
  transform: scale(1.1) rotate(5deg);
}

.permission-icon.administrativo {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.permission-icon.recepcionista {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.permission-icon.paciente {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.permission-content h4 {
  color: #1e293b;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.permission-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.permission-content ul li {
  color: #64748b;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.permission-content ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #06b6d4;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Profile Restrictions */
.profile-restrictions {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 2rem;
  border-radius: 16px;
  border-left: 5px solid #f59e0b;
  animation: slideInRight 0.6s ease-out 0.5s backwards;
}

.profile-restrictions h3 {
  color: #92400e;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.restriction-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.restriction-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #1e293b;
  font-size: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.restriction-item:hover {
  background: rgba(255,255,255,0.9);
  transform: translateX(8px);
}

.restriction-item i {
  color: #10b981;
  font-size: 1.2rem;
}

.restriction-item.warning i {
  color: #ef4444;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  padding: 2rem 1rem;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 3s infinite;
}

footer p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .profile-title {
    font-size: 2rem;
  }
  
  .permission-item {
    flex-direction: column;
    text-align: center;
  }
  
  .permission-icon {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1.5rem 3rem;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero-icon {
    font-size: 3rem;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  
  .profile-header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }
  
  .profile-title {
    font-size: 1.8rem;
  }
  
  .profile-subtitle {
    font-size: 1rem;
  }
  
  .profile-body {
    padding: 2rem 1.5rem;
  }
  
  .profile-image {
    height: 250px;
  }
  
  .permissions-grid > h3 {
    font-size: 1.5rem;
  }
  
  .permission-item {
    padding: 1.5rem;
  }
  
  .permission-content h4 {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .selector-wrapper {
    padding: 0 1rem;
  }
  
  .profile-select {
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
  }
  
  .profile-description,
  .profile-restrictions {
    padding: 1.5rem;
  }
}