/* ========================================
   F1PeruIA - Branding Styles
   basado en logo F1Peru Help On-line
   ======================================== */

:root {
  /* === Colores principales del logo === */
  --f1-red: #E53935;
  --f1-red-dark: #C62828;
  --f1-red-light: #EF5350;
  --f1-blue: #1E88E5;
  --f1-blue-dark: #1565C0;
  --f1-blue-light: #42A5F5;
  --f1-black: #1a1a1a;
  --f1-gray: #666666;
  --f1-gray-light: #999999;
  --f1-gray-bg: #F5F5F5;
  --f1-white: #FFFFFF;
  
  /* === Colores de acento === */
  --f1-accent: #FFC107;
  --f1-accent-hover: #FFB300;
  --f1-success: #4CAF50;
  --f1-error: #E53935;
  
  /* === Gradientes del logo === */
  --f1-gradient-red: linear-gradient(135deg, #E53935 0%, #C62828 100%);
  --f1-gradient-blue: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
  --f1-gradient-dark: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  
  /* === Sombras === */
  --f1-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --f1-shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --f1-shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  
  /* === Bordes === */
  --f1-radius-sm: 8px;
  --f1-radius-md: 12px;
  --f1-radius-lg: 16px;
  --f1-radius-full: 999px;
  
  /* === Tipografía === */
  --f1-font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f1-font-weight-normal: 400;
  --f1-font-weight-medium: 500;
  --f1-font-weight-semibold: 600;
  --f1-font-weight-bold: 700;
  --f1-font-weight-extrabold: 800;
}

/* === Reset y base === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--f1-font-family);
  background: var(--f1-gray-bg);
  color: var(--f1-black);
  min-height: 100vh;
}

/* === Header branding === */
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 46px;
  width: auto;
  display: block;
}

.header-titles {
  text-align: left;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: var(--f1-font-weight-extrabold);
  color: var(--f1-black);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

header h1 span.f1-red {
  color: var(--f1-red);
}

header h1 span.f1-blue {
  color: var(--f1-blue);
}

header p {
  margin: 2px 0 0;
  color: var(--f1-gray);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Botones === */
.btn-f1 {
  background: var(--f1-red);
  color: var(--f1-white);
  border: none;
  border-radius: var(--f1-radius-md);
  padding: 12px 24px;
  font-weight: var(--f1-font-weight-bold);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
}

.btn-f1:hover {
  background: var(--f1-red-dark);
  transform: translateY(-1px);
}

.btn-f1:active {
  transform: translateY(0);
}

.btn-f1:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-f1-secondary {
  background: var(--f1-blue);
  color: var(--f1-white);
}

.btn-f1-secondary:hover {
  background: var(--f1-blue-dark);
}

/* === Badges === */
.badge-f1 {
  display: inline-flex;
  align-items: center;
  background: var(--f1-red);
  color: var(--f1-white);
  padding: 5px 12px;
  border-radius: var(--f1-radius-full);
  font-size: 0.7rem;
  font-weight: var(--f1-font-weight-bold);
  white-space: nowrap;
}

.badge-f1.success {
  background: var(--f1-success);
}

.badge-f1.error {
  background: var(--f1-error);
}

/* === Cards === */
.card-f1 {
  background: var(--f1-white);
  border: 1px solid #E0E0E0;
  border-radius: var(--f1-radius-lg);
  padding: 20px;
  box-shadow: var(--f1-shadow-md);
  transition: box-shadow 0.2s;
}

.card-f1:hover {
  box-shadow: var(--f1-shadow-lg);
}

/* === Chat bubbles === */
.bubble-f1.user {
  background: var(--f1-black);
  color: var(--f1-white);
}

.bubble-f1.assistant {
  background: #F9FFF4;
  border: 1px solid #C5E1A5;
}

/* === Footer chat === */
.chat-bar-f1 {
  background: var(--f1-white);
  border: 1px solid #E8E8E8;
  border-radius: var(--f1-radius-full);
  box-shadow: var(--f1-shadow-lg);
}

.chat-send-f1 {
  background: var(--f1-blue);
}

.chat-send-f1:hover {
  background: var(--f1-blue-dark);
}

/* === SQL Box === */
.sqlbox-f1 {
  background: var(--f1-gray-bg);
  border: 1px solid #E0E0E0;
  border-radius: var(--f1-radius-md);
  padding: 14px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow: auto;
  color: var(--f1-black);
}

/* === Tables === */
table-f1 {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 12px;
  display: block;
  max-height: 420px;
  overflow: auto;
  border-radius: var(--f1-radius-md);
  border: 1px solid #E0E0E0;
}

table-f1 th {
  background: var(--f1-black);
  color: var(--f1-white);
  position: sticky;
  top: 0;
  font-weight: var(--f1-font-weight-semibold);
}

table-f1 tr:nth-child(even) {
  background: var(--f1-gray-bg);
}

table-f1 tr:hover {
  background: #FFF8E1;
}

/* === Login box === */
.login-box-f1 {
  background: var(--f1-white);
  border-radius: var(--f1-radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--f1-shadow-lg);
  border: 1px solid #E0E0E0;
  text-align: center;
}

.login-box-f1 .logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
  border-radius: var(--f1-radius-md);
}

/* === Animations === */
@keyframes pulse-f1 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.animate-pulse {
  animation: pulse-f1 2s infinite;
}
