/* ==========================================================================
   syssecure.pl - Splash Screen Styles
   ========================================================================== */

/* Animation fallback (in case common.css doesn't load) */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* CSS Variable fallbacks for when common.css doesn't load */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent-purple: #a855f7;
  --accent-purple-light: #c084fc;
  --accent-pink: #ec4899;
  --border-default: #27272a;
  --border-accent: rgba(168, 85, 247, 0.5);
  --gradient-primary: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --gradient-text: linear-gradient(135deg, #c084fc 0%, #f472b6 100%);
  --glow-combined: 0 0 30px rgba(168, 85, 247, 0.3), 0 0 60px rgba(236, 72, 153, 0.2);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  --radius-sm: 0.25rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --z-fixed: 300;
  --z-modal: 400;
}

/* Base styles fallback */
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

/* Background gradient effect */
.splash::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(168, 85, 247, 0.08) 0%,
    rgba(236, 72, 153, 0.04) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Header with language toggle */
.splash-header {
  position: fixed;
  top: 0;
  right: 0;
  padding: var(--space-4);
  z-index: var(--z-fixed);
}

/* Main content container */
.splash-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  width: 100%;
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

/* Fallback for when animations don't work */
@media (prefers-reduced-motion: reduce) {
  .splash-content,
  .splash-remember,
  .splash-footer {
    opacity: 1;
    animation: none;
  }
}

/* No-JS fallback - ensure content is visible without JavaScript */
.no-js .splash-content,
.no-js .splash-remember,
.no-js .splash-footer {
  opacity: 1;
  animation: none;
}

/* Safety fallback - ensure visibility after animation should have completed */
@supports (animation: fadeIn 1s) {
  .splash-content,
  .splash-remember,
  .splash-footer {
    /* Animation will handle visibility, but add safety delay */
  }
}

/* Ultra-safe fallback using animation-fill-mode explicitly */
.splash-content {
  animation-fill-mode: forwards;
  -webkit-animation-fill-mode: forwards;
}

.splash-remember {
  animation-fill-mode: forwards;
  -webkit-animation-fill-mode: forwards;
}

.splash-footer {
  animation-fill-mode: forwards;
  -webkit-animation-fill-mode: forwards;
}

/* Logo/Title */
.splash-logo {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .splash-logo {
    font-size: var(--text-5xl);
  }
}

/* Subtitle */
.splash-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-12);
}

/* Mode selection cards container */
.splash-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (min-width: 600px) {
  .splash-cards {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

/* Mode selection card */
.splash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.splash-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
}

.splash-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--glow-combined);
}

.splash-card:hover::before {
  opacity: 0.05;
}

.splash-card > * {
  position: relative;
  z-index: 1;
}

/* Card icon area */
.splash-card-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  transition: all var(--transition-base);
}

.splash-card:hover .splash-card-icon {
  background: rgba(168, 85, 247, 0.1);
}

/* Icon SVGs */
.splash-card-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.5;
  transition: stroke var(--transition-base);
}

.splash-card:hover .splash-card-icon svg {
  stroke: var(--accent-purple);
}

/* Terminal mockup in icon area */
.terminal-mockup {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.4;
}

.terminal-mockup .prompt {
  color: var(--accent-purple);
}

.terminal-mockup .command {
  color: var(--text-primary);
}

/* Card title */
.splash-card-title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

/* Card description */
.splash-card-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Remember choice checkbox */
.splash-remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
  animation-delay: 200ms;
}

.splash-remember input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.splash-remember input[type="checkbox"]:hover {
  border-color: var(--border-accent);
}

.splash-remember input[type="checkbox"]:checked {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

.splash-remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.splash-remember input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

.splash-remember label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Footer hint */
.splash-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
  animation-delay: 400ms;
}

.splash-footer a {
  color: var(--accent-purple);
  transition: color var(--transition-fast);
}

.splash-footer a:hover {
  color: var(--accent-purple-light);
}

/* Keyboard shortcut hints */
.splash-shortcuts {
  margin-top: var(--space-2);
}

.splash-shortcuts kbd {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  margin: 0 var(--space-1);
}

/* Loading state when redirecting */
.splash-loading {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
}

.splash-loading.active {
  display: flex;
}

.splash-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.splash-loading-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* No JS fallback */
.no-js .splash-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.no-js .splash-remember {
  display: none;
}
