/* ==========================================
   Portal Unificado - mebot.online
   Estilos principales
========================================== */

/* Reset y variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --transition: all 0.2s ease-in-out;
}

/* Reset base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  letter-spacing: -0.5px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.user-email {
  font-weight: 500;
}

.logout-btn {
  background: var(--danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
}

.logout-btn:hover {
  background: #dc2626;
}

/* Main Dashboard */
.dashboard {
  flex: 1;
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -1px;
}

.user-name-display {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  font-weight: 400;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  font-size: 1.25rem;
  color: var(--text-light);
}

/* Service Card */
.service-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.service-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.service-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-online {
  background-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-maintenance {
  background-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-offline {
  background-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
}

.service-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.service-description {
  font-size: 0.938rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  line-height: 1.5;
}

.open-service-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.875rem 1.5rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  width: 100%;
}

.open-service-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.open-service-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.open-service-btn.btn-maintenance {
  background: var(--warning);
}

.open-service-btn.btn-offline {
  background: var(--text-light);
}

/* Info Section */
.info-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.info-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.help-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.help-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  background: var(--bg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  min-width: 180px;
}

.help-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.help-icon {
  font-size: 2rem;
}

.help-link span:last-child {
  font-weight: 600;
  font-size: 0.938rem;
}

/* Footer */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

.footer-version {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .help-links {
    flex-direction: column;
    align-items: center;
  }
  
  .help-link {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  . header .container {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  .logo-icon {
    font-size: 1.75rem;
  }
}

/* Animaciones suaves */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-card {
  animation: fadeIn 0.3s ease-out;
}

/* Utilidades */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
