/* voestalpine × GERMANTECH Portal Styles */
/* Based on extracted design system from reference files */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Brand Colors (voestalpine + GERMANTECH) */
  --brand-red: #c8102e;
  --brand-red-light: #ff6b6b;
  --brand-dark: #1f2933;
  --brand-steel: #525760;
  --germantech-blue: #1e40af;
  
  /* Gradients */
  --voestalpine-gradient: linear-gradient(90deg, #c8102e 0%, #ff6b6b 60%);
  --hero-gradient: linear-gradient(135deg, rgba(200,16,46,0.95) 0%, rgba(82,87,96,0.95) 100%);
  --section-gradient: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.9));
  
  /* Neutral Colors */
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Spacing & Layout */
  --container-max: 1200px;
  --radius: 8px;
  --radius-lg: 12px;
  --gap: 16px;
  --gap-lg: 24px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.12);
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: var(--font-size-base);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Component */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: saturate(120%) blur(4px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  text-decoration: none;
  display: inline-block;
}

.logo-placeholder {
  font-size: 18px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-secondary);
}

.site-meta {
  display: none; /* Hidden on mobile */
}

.site-title {
  font-size: var(--font-size-lg);
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.site-subtitle {
  font-size: var(--font-size-sm);
  margin: 0;
  color: var(--text-muted);
}

/* Navigation */
.site-nav {
  display: none; /* Hidden on mobile, show on desktop */
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-tertiary);
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* voestalpine Gradient Utility */
.voestalpine-gradient {
  background: var(--voestalpine-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Auth Pages */
.auth-page {
  min-height: 100vh;
  background: var(--hero-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  text-align: center;
}

.auth-header {
  margin-bottom: 32px;
}

.auth-header .logo-placeholder {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 24px;
}

.auth-header h1 {
  margin: 0 0 8px 0;
  font-size: var(--font-size-2xl);
  font-weight: 600;
}

.auth-subtitle {
  color: var(--text-muted);
  margin: 0;
}

/* Forms */
.auth-form {
  text-align: left;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--brand-red);
  color: white;
}

.btn-primary:hover {
  background: #a80d26;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--brand-red);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
}

.btn-icon {
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--bg-secondary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

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

/* Auth Divider */
.auth-divider {
  margin: 24px 0;
  text-align: center;
  position: relative;
  color: var(--text-muted);
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  background: var(--surface);
  padding: 0 16px;
}

/* Auth Footer */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.auth-footer a {
  color: var(--brand-red);
  text-decoration: none;
}

/* Dashboard */
.dashboard {
  padding: 40px 0;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 48px;
}

.dashboard-header h1 {
  font-size: var(--font-size-3xl);
  margin: 0 0 12px 0;
  font-weight: 600;
}

.dashboard-subtitle {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin: 0;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.card-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--voestalpine-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.card-content {
  flex: 1;
}

.card-content h3 {
  margin: 0 0 8px 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.card-content p {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.card-action {
  color: var(--text-muted);
  font-size: 18px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

/* Admin Section */
.admin-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-card:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

/* Content Pages */
.content-page {
  padding: 40px 0;
}

.content-header {
  text-align: center;
  margin-bottom: 48px;
}

.content-header h1 {
  font-size: var(--font-size-4xl);
  margin: 0 0 12px 0;
  font-weight: 600;
}

.content-subtitle {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin: 0;
}

.content-sections {
  max-width: 800px;
  margin: 0 auto;
}

.section {
  margin-bottom: 48px;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: var(--font-size-2xl);
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.section-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.metric-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  position: relative;
}

.metric-card.verified {
  border-left: 4px solid var(--success);
}

.metric-card.warning {
  border-left: 4px solid var(--warning);
}

.metric-card.problematic {
  border-left: 4px solid var(--danger);
}

.metric-icon {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--brand-red);
}

.metric-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.metric-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.metric-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.metric-source {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-red);
  border: 3px solid var(--surface);
}

.timeline-time {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--brand-red);
  margin-bottom: 8px;
}

.timeline-content h4 {
  margin: 0 0 8px 0;
  font-weight: 600;
}

.timeline-content p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Trend Cards */
.trend-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.trend-card {
  padding: 24px;
  text-align: center;
}

.trend-card .card-icon {
  width: auto;
  height: auto;
  background: none;
  margin-bottom: 16px;
  font-size: 32px;
  color: var(--brand-red);
}

.trend-card h4 {
  margin: 0 0 12px 0;
  font-weight: 600;
  color: var(--text);
}

.trend-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Verification List */
.verification-list {
  margin: 24px 0;
}

.verification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--bg-secondary);
}

.verification-item.verified {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
}

.verification-item i {
  color: var(--success);
  font-size: 18px;
  margin-top: 2px;
}

.verification-item strong {
  display: block;
  margin-bottom: 4px;
}

.source {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
}

/* Admin Panel */
.admin-page {
  padding: 40px 0;
}

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

.admin-section {
  margin-bottom: 48px;
}

.admin-section h2 {
  font-size: var(--font-size-xl);
  margin: 0 0 24px 0;
  font-weight: 600;
}

/* Table */
.invites-table {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}

.table-row:last-child {
  border-bottom: none;
}

.table-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.token-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-token {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: var(--font-size-sm);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-admin {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-user {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Footer */
.site-footer {
  background: var(--brand-dark);
  color: #e2e8f0;
  padding: 48px 0 0 0;
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
  min-width: 0;
}

.footer-heading {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0 0 16px 0;
  color: white;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 8px;
}

.footer-list a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-list a:hover {
  color: white;
}

.footer-desc {
  color: #94a3b8;
  line-height: 1.6;
  margin: 16px 0 0 0;
}

.footer-brand .logo-placeholder {
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.15s ease;
}

.social-link:hover {
  background: var(--brand-red);
  color: white;
  transform: translateY(-1px);
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  color: #94a3b8;
  font-size: var(--font-size-sm);
}

.footer-bottom a {
  color: #cbd5e1;
  text-decoration: none;
}

/* Messages */
.app-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 1000;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.app-message-error {
  background: var(--danger);
  color: white;
}

.app-message-success {
  background: var(--success);
  color: white;
}

/* Responsive Design */
@media (min-width: 640px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .site-nav {
    display: block;
  }
  
  .site-meta {
    display: block;
  }
  
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
  
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 32px;
  }
  
  .dashboard-cards {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .content-sections {
    max-width: 900px;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .btn {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

.btn:focus,
.form-input:focus {
  outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-muted: #333333;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}