/* frontend/css/shared.css */

:root {
  --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --bg-app: #090d16;
  --bg-card: rgba(17, 25, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --gold: #fbbf24;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
}

/* Glassmorphic Header & Logo Badge */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 24px;
  border-radius: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-section h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Authentication Overlay & Modals */
.auth-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1200;
}

.auth-modal {
  width: 360px;
  max-width: 92%;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 28px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-main);
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.auth-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.auth-form input, .auth-modal select, .auth-modal input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  margin-bottom: 12px;
  font-size: 14px;
  transition: all 0.2s;
}

.auth-form input:focus, .auth-modal select:focus, .auth-modal input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.auth-action {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s;
  text-align: center;
  text-decoration: none;
}

.auth-action:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.auth-switch {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch:hover {
  color: #818cf8;
}

/* Category Tabs, Wrappers, Carousels & Scroll Arrows */
.category-tabs-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-tabs-container {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none; /* Hide scrollbar IE */
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

.category-tabs-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar WebKit */
}

.scroll-arrow {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 24px;
  height: 36px;
  padding: 0 4px;
  flex-shrink: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease, color 0.2s ease, transform 0.2s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scroll-arrow.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scroll-arrow:hover {
  color: var(--text-main);
  transform: scale(1.25);
}

.category-tabs {
  display: flex;
  gap: 10px;
  width: max-content;
}

.cat-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 6px 16px var(--primary-glow);
}

/* Card Summary overlays & actions */
.col-card {
  position: relative !important;
}

.col-card .img {
  position: relative !important;
}

.col-card .card-action-btn-group {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 20;
}

.col-card .external-link-btn, .col-card .info-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(12, 43, 71, 0.9);
  color: #bda07a;
  border: 1px solid rgba(189, 160, 122, 0.4);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.col-card .external-link-btn:hover, .col-card .info-btn:hover {
  background: #0c2b47;
  color: #ffffff;
  border-color: #bda07a;
}

.col-card-summary-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 43, 71, 0.98);
  color: #ffffff;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: inherit;
  text-align: left;
}

.col-card-summary-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Tooltips */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-weight: 600;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* version-url-link */
.version-url-link {
  display: none;
  align-items: center;
  gap: 6px;
  color: #718096;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

body.version-id-2 .version-url-link {
  display: inline-flex;
  color: #bda07a;
  border-color: rgba(189, 160, 122, 0.25);
  background: rgba(189, 160, 122, 0.05);
}

body.version-id-2 .version-url-link:hover {
  color: #0c2b47;
  background: rgba(189, 160, 122, 0.12);
  border-color: #bda07a;
  text-decoration: none;
}

/* ==========================================
   Parliament (Version 2) Layout Overrides
   ========================================== */
body.version-id-2 {
  background-color: #faf9f6;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(12, 43, 71, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(189, 160, 122, 0.05) 0%, transparent 40%);
  color: #1a202c;
}

body.version-id-2 .header {
  background: #ffffff;
  border: 1px solid #e5dfd3;
  box-shadow: 0 4px 20px rgba(12, 43, 71, 0.04);
}

body.version-id-2 .logo-section h1 {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: initial;
  color: #0c2b47;
}

body.version-id-2 .logo-badge {
  background: #0c2b47;
  color: #ffffff;
  border: 1px solid #bda07a;
}

body.version-id-2 .user-btn {
  background: #ffffff;
  border: 1px solid #e5dfd3;
  color: #0c2b47;
}

body.version-id-2 .user-btn:hover {
  background: #faf9f6;
  border-color: #bda07a;
  color: #0c2b47;
}

body.version-id-2 .cat-tab {
  background: #ffffff;
  border: 1px solid #e5dfd3;
  color: #4a5568;
}

body.version-id-2 .cat-tab:hover {
  background: #faf9f6;
  color: #0c2b47;
}

body.version-id-2 .cat-tab.active {
  background: #0c2b47;
  border-color: #0c2b47;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(12, 43, 71, 0.2);
}

body.version-id-2 .scroll-arrow {
  color: #718096;
}

body.version-id-2 .scroll-arrow:hover {
  color: #0c2b47;
}

body.version-id-2 .auth-overlay {
  background: rgba(12, 43, 71, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

body.version-id-2 .auth-modal {
  background: #ffffff !important;
  border: 1px solid #e5dfd3 !important;
  color: #1a202c !important;
  box-shadow: 0 20px 40px rgba(12, 43, 71, 0.15) !important;
}

body.version-id-2 .auth-header #authTitle, 
body.version-id-2 .auth-header #authTitle strong {
  color: #0c2b47 !important;
  font-family: var(--font-heading) !important;
}

body.version-id-2 .auth-close {
  background: rgba(12, 43, 71, 0.05) !important;
  color: #0c2b47 !important;
}

body.version-id-2 .auth-close:hover {
  background: rgba(12, 43, 71, 0.12) !important;
}

body.version-id-2 .auth-form input {
  background: #faf9f6 !important;
  border: 1px solid #e5dfd3 !important;
  color: #1a202c !important;
}

body.version-id-2 .auth-form input:focus {
  border-color: #0c2b47 !important;
  background: #ffffff !important;
}

body.version-id-2 .auth-action {
  background: #0c2b47 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(12, 43, 71, 0.2) !important;
}

body.version-id-2 .auth-action:hover {
  background: #0e385c !important;
  box-shadow: 0 6px 16px rgba(12, 43, 71, 0.3) !important;
}

body.version-id-2 .auth-switch {
  color: #bda07a !important;
}

body.version-id-2 .auth-switch:hover {
  color: #a98d65 !important;
}

/* Responsive utilities */
@media (max-width: 600px) {
  .logo-section h1 {
    font-size: 20px;
  }
}
