/*
Theme Name: PowerBI Dashboard
Theme URI: https://reporting.asproparks.com/  
Description: Tema responsive para dashboards de Power BI con login obligatorio
Version: 1.0.0
Author: JBP - Grupo Active - UNIKAL
Author URI: https://unikal.tech
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: powerbi-dashboard
Domain Path: /languages
*/

/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* ============================================
   404
   ============================================ */

.powerbi-404 {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0b1020 100%);
}

.powerbi-404__card {
  width: 100%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
}

.powerbi-404__title {
  font-size: 72px;
  line-height: 1;
  letter-spacing: 4px;
  margin-bottom: 10px;
  color: #38bdf8;
}

.powerbi-404__subtitle {
  font-size: 20px;
  margin-bottom: 12px;
  color: #f8fafc;
}

.powerbi-404__text {
  font-size: 14px;
  color: #cbd5f5;
  margin-bottom: 24px;
}

.powerbi-404__btn {
  display: inline-block;
  padding: 12px 22px;
  background: #38bdf8;
  color: #0b1020;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.powerbi-404__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
}

@media (max-width: 480px) {
  .powerbi-404__card {
    padding: 28px 20px;
  }

  .powerbi-404__title {
    font-size: 56px;
  }
}

/* ============================================
   PANTALLA DE LOGIN
   ============================================ */

.login-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

.login-form-section {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  padding: 40px;
}

.login-image-section {
  width: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo img {
  max-width: 200px;
  height: auto;
}

.login-form-wrapper h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  color: #333;
}

.login-form-wrapper .form-group {
  margin-bottom: 20px;
}

.login-form-wrapper label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.login-form-wrapper input[type="text"],
.login-form-wrapper input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.login-form-wrapper input[type="text"]:focus,
.login-form-wrapper input[type="password"]:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.login-form-wrapper button {
  width: 100%;
  padding: 12px;
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-form-wrapper button:hover {
  background-color: #005a87;
}

.login-form-wrapper .login-error {
  color: #d32f2f;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #ffebee;
  border-radius: 4px;
  font-size: 14px;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-container {
  display: flex;
  height: 100vh;
  width: 100%;
  transition: margin-left 0.3s ease;
}

.dashboard-container.menu-open {
  margin-left: 200px;
}

/* SIDEBAR */
.dashboard-sidebar {
  width: 280px;
  background: linear-gradient(180deg, #1a2332 0%, #2c3e50 100%);
  color: white;
  padding: 0;
  overflow-y: hidden;
  transition: transform 0.3s ease;
  position: fixed;
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 997;
  top: 0;
  left: 0;
  transform: translateX(-280px);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.dashboard-sidebar.mobile-hidden {
  transform: translateX(-280px);
}

.dashboard-sidebar.mobile-visible {
  transform: translateX(0);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0f1823 0%, #1a2332 100%);
  position: relative;
}

/* Menu de reportes con scroll */
.menu-reports {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  overflow-y: auto;
  flex: 1;
}

.dashboard-logo {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.dashboard-logo img {
  max-width: 100px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.dashboard-header .hamburger-btn {
  position: absolute;
  left: 15px;
}

.hamburger-btn {
  display: block;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.3s ease;
  z-index: 999;
  position: relative;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* Hamburguesa flotante para desktop */
.hamburger-desktop {
  display: block;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  background-color: rgba(44, 62, 80, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 24px;
  padding: 10px 15px;
  margin-right: 0;
}

.hamburger-desktop:hover {
  background-color: rgba(44, 62, 80, 1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Ocultar hamburguesa flotante cuando el menú está abierto */
.dashboard-container.menu-open .hamburger-desktop {
  display: none;
}

/* Hamburguesa para móvil */
.hamburger-mobile {
  display: none;
}

.menu-reports {
  list-style: none;
  padding: 20px 0;
  flex: 1;
}

.menu-reports li {
  margin-bottom: 0;
}

.menu-reports a {
  display: block;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
}

.menu-reports a:hover {
  background-color: rgba(0, 115, 170, 0.2);
  color: #4fc3f7;
  border-left-color: #4fc3f7;
  padding-left: 20px;
}

.menu-reports a.active {
  background-color: rgba(0, 115, 170, 0.3);
  color: #4fc3f7;
  border-left-color: #0073aa;
  padding-left: 20px;
}

.dashboard-user-section {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.dashboard-user-info {
  font-size: 12px;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.dashboard-user-info strong {
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 5px;
}

.dashboard-logout-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.dashboard-logout-btn:hover {
  background: linear-gradient(135deg, #b71c1c 0%, #8b0000 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

.dashboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dashboard-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 30px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffff;
  text-align: center;
}

.dashboard-main {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.report-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.report-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.report-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 18px;
  text-align: center;
  padding: 40px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (min-width: 769px) {
  .hamburger-mobile {
    display: none;
  }

  .hamburger-desktop {
    display: block;
  }

  .dashboard-sidebar {
    position: fixed;
    transform: translateX(-280px);
    width: 280px;
    max-width: 280px;
  }

  .dashboard-sidebar.mobile-visible {
    transform: translateX(0);
  }

  .dashboard-sidebar.mobile-hidden {
    transform: translateX(-280px);
  }

  .dashboard-container.menu-open {
    margin-left: 200px;
  }
}

@media (max-width: 768px) {
  /* Login */
  .login-container {
    flex-direction: column;
  }

  .login-form-section {
    width: 100%;
    height: 60%;
  }

  .login-image-section {
    width: 100%;
    height: 40%;
  }

  /* Dashboard */
  .dashboard-container {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 80%;
    max-width: 300px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 998;
    margin-left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .dashboard-sidebar.mobile-visible {
    transform: translateX(0);
  }

  .dashboard-sidebar.mobile-hidden {
    transform: translateX(-100%);
  }

  .dashboard-container.menu-open {
    margin-left: 0;
  }

  .hamburger-btn {
    display: block;
    position: relative;
    margin-right: 0;
  }

  .hamburger-btn.hamburger-mobile {
    display: block;
    position: relative;
    margin-right: 15px;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    font-size: 20px;
    padding: 5px 10px;
  }

  .hamburger-desktop {
    display: none;
  }

  .dashboard-header .hamburger-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  .dashboard-content {
    width: 100%;
  }

  .dashboard-top-bar {
    padding: 15px;
  }

  .dashboard-title {
    font-size: 20px;
  }

  .dashboard-main {
    padding: 15px;
  }

  .report-container {
    height: calc(100vh - 150px);
  }
}

@media (max-width: 480px) {
  .login-form-section {
    padding: 20px;
  }

  .login-form-wrapper {
    max-width: 100%;
  }

  .login-form-wrapper h1 {
    font-size: 24px;
  }

  .dashboard-sidebar {
    width: 100%;
    max-width: none;
  }

  .dashboard-top-bar {
    padding: 12px;
  }

  .dashboard-title {
    font-size: 18px;
  }

  .dashboard-main {
    padding: 10px;
  }
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes slideInMenu {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ============================================
   UTILIDADES
   ============================================ */

.report-loading {
  opacity: 0.6;
  pointer-events: none;
}

.report-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
