/* Red Guild Password Card - Clean, Professional Design */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #2d3748;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
  margin-bottom: 3rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Password Card - Display size (larger for better visibility) */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  padding: 1.5rem;
  width: 720px; /* Larger display size */
  height: 420px; /* Proportional height */
  border: 1px solid #e2e8f0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #dc2626;
  flex-shrink: 0;
}

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

.logo {
  height: 28px;
  width: auto;
}

.branding {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9rem;
  color: #dc2626;
  font-weight: 600;
  letter-spacing: 0.75px;
}

/* Realistic Keyboard Layout */
.keyboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem;
}

.keyboard-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  justify-content: center;
  align-items: stretch;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

/* Row spacers for realistic keyboard indentation */
.row-spacer {
  width: 0.5rem;
  flex-shrink: 0;
}

.row-spacer.spacer-wide {
  width: 1.5rem;
}

/* Standard keys */
.key {
  flex: 1;
  min-height: 48px;
  max-width: 55px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
  font-size: 0.85rem;
}

/* Spacebar styling */
.key-spacebar {
  flex: 8;
  max-width: none;
  min-height: 55px;
}

.key:hover {
  border-color: #cbd5e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.key span {
  padding: 3px;
  text-align: center;
  font-weight: 600;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.8rem;
}

.key span:first-child {
  background: #2d3748;
  color: white;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid #4a5568;
}

.key span.gen {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
}

.key-spacebar span.gen {
  font-size: 1rem;
  letter-spacing: 1.5px;
}

/* Main Controls - Minimalist UI */
.main-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.primary-btn {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.secondary-btn {
  background: white;
  color: #4a5568;
  border: 2px solid #e2e8f0;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-btn {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  color: #4a5568;
  padding: 12px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e0;
  transform: rotate(90deg);
}

/* Seed Input Section */
.seed-input-section {
  margin: 1rem 0;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.seed-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.seed-input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9rem;
  background: white;
}

/* Settings Panel */
.card-settings {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #dc2626;
}

.settings-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f3f4f6;
  color: #dc2626;
}

.card-settings h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 1rem;
  margin-top: 0;
}

.current-seed-display {
  display: flex;
  gap: 8px;
  align-items: center;
}

.current-seed-display input {
  flex: 1;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  color: #4a5568;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* Bulk generation styles */
.bulk-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.bulk-input-group input {
  flex: 1;
  max-width: 150px;
}

.bulk-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
  font-style: italic;
}

.seed-section, .customization-section, .actions-section, .bulk-section {
  margin-bottom: 2rem;
}

.seed-section:last-child, .customization-section:last-child, .actions-section:last-child, .bulk-section:last-child {
  margin-bottom: 0;
}

.row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.row label {
  font-weight: 500;
  color: #4a5568;
  min-width: 120px;
  text-align: left;
}

.seed-input-group {
  display: flex;
  flex: 1;
  gap: 8px;
}

.seed-actions, .save-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Form Elements */
input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: #f7fafc;
}

input[type="text"]:focus {
  outline: none;
  border-color: #dc2626;
  background: white;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

input#seed {
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 1rem;
}

/* Buttons */
button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  text-transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

/* Primary Buttons */
#generate-seed, #go {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
}

#generate-seed:hover, #go:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

/* Secondary Buttons */
#load-seed, #print {
  background: #4a5568;
  color: white;
}

#load-seed:hover, #print:hover {
  background: #2d3748;
}

/* Action Buttons */
#save-image, #save-json {
  background: #3182ce;
  color: white;
}

#save-image:hover, #save-json:hover {
  background: #2c5282;
}

/* Copy Button */
#copy-seed {
  background: #38a169;
  color: white;
  padding: 12px 16px;
  min-width: 48px;
  font-size: 1rem;
}

#copy-seed:hover {
  background: #2f855a;
}

/* Bulk Generate Button */
#bulk-generate {
  background: #f59e0b;
  color: #92400e;
  font-size: 11pt;
  padding: 0.5rem 1rem;
  border: 2px solid #d97706;
}

#bulk-generate:hover {
  background: #fbbf24;
  border-color: #b45309;
}

#bulk-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Instructions */
.instructions {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

/* Warning Callout */
.warning-callout {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warning-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.warning-text {
  color: #991b1b;
  font-weight: 500;
  font-size: 0.95rem;
}

.instructions h2 {
  color: #1a202c;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.instructions p {
  color: #4a5568;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.instructions ol {
  list-style: none;
  counter-reset: step-counter;
}

.instructions li {
  counter-increment: step-counter;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 3rem;
}

.instructions li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

code {
  display: block;
  margin-top: 0.5rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

code input {
  width: 100%;
  background: white;
  border: 2px solid #e2e8f0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 1rem;
  letter-spacing: 2px;
  font-weight: 600;
  color: #2d3748;
}

/* Footer */
.footer {
  background: #1a202c;
  color: white;
  padding: 0.75rem 0;
  margin-top: 1rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}

.footer-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo {
  height: 120px;
  width: auto;
}

.footer-tagline {
  font-weight: 500;
  font-size: 1.1rem;
  color: #e2e8f0;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer p {
  margin-bottom: 0.5rem;
  opacity: 0.8;
  text-align: center;
}

.footer .note {
  color: #fbb6ce;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Make spacebar row narrower on desktop */
.keyboard-row.row-space {
  margin: 0 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .card {
    padding: 1rem;
    margin: 1rem auto;
    width: 100%; /* Full width on mobile */
    max-width: 450px; /* Constrain max width */
    height: 280px; /* Increased height to fit all content */
  }
  
  .keyboard {
    padding: 0.5rem;
  }
  
  .keyboard-row {
    gap: 4px;
    margin-bottom: 4px;
  }
  
  .key {
    min-height: 28px;
    max-width: 28px;
    border-radius: 2px;
  }
  
  .key span {
    padding: 2px;
    font-size: 0.55rem;
  }
  
  .key span.gen {
    font-size: 0.6rem;
  }
  
  .key-spacebar {
    min-height: 30px;
    flex: 4;
    max-width: none;
  }
  
  .key-spacebar span.gen {
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    font-weight: 700;
  }
  
  .row-spacer {
    width: 0.25rem;
  }
  
  .row-spacer.spacer-wide {
    width: 0.75rem;
  }
  
  /* Override desktop spacebar margin for mobile */
  .keyboard-row.row-space {
    margin: 0 3rem;
  }
  
  /* Mobile main controls */
  .main-controls {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .primary-btn, .secondary-btn {
    width: 100%;
    padding: 12px 24px;
  }
  
  .settings-btn {
    align-self: center;
    width: auto;
  }
  
  /* Mobile settings */
  .card-settings {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .row label {
    min-width: auto;
    margin-bottom: 0.5rem;
    text-align: left;
  }
  
  .save-options {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .save-options button {
    width: 100%;
  }
}

/* Print Styles - Business Card Format */
@media print {
  @page {
    size: 3.5in 2in;
    margin: 0;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  html, body {
    width: 3.5in !important;
    height: 2in !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    font-family: 'Inter', Arial, sans-serif !important;
    overflow: hidden !important;
  }
  
  /* Hide everything except the card */
  body > *:not(.card) {
    display: none !important;
  }
  
  .header, .container, .card-settings, .instructions, .footer {
    display: none !important;
  }
  
  /* Print card layout */
  .card {
    width: 3.5in !important;
    height: 2in !important;
    margin: 0 !important;
    padding: 0.1in !important;
    background: white !important;
    border: 2px solid black !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    page-break-inside: avoid !important;
  }
  
  /* Card header */
  .card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 0.05in !important;
    margin-bottom: 0.05in !important;
    border-bottom: 1px solid black !important;
    flex-shrink: 0 !important;
  }
  
  .logo-section {
    display: flex !important;
    align-items: center !important;
  }
  
  .logo {
    height: 0.1in !important;
    width: auto !important;
  }
  
  .branding {
    font-size: 7pt !important;
    color: black !important;
    font-weight: bold !important;
    font-family: Monaco, Courier, monospace !important;
  }
  
  /* Keyboard layout */
  .keyboard {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 0.05in 0 !important;
  }
  
  .keyboard-row {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 0.02in !important;
    margin-bottom: 0.02in !important;
  }
  
  .keyboard-row:last-child {
    margin-bottom: 0 !important;
  }
  
  /* Row spacers */
  .row-spacer {
    width: 0.05in !important;
  }
  
  .row-spacer.spacer-wide {
    width: 0.1in !important;
  }
  
  /* Keys */
  .key {
    flex: 1 !important;
    height: 0.25in !important;
    max-width: 0.25in !important;
    background: white !important;
    border: 1px solid black !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  .key-spacebar {
    flex: 8 !important;
    max-width: none !important;
    height: 0.3in !important;
  }
  
  .key span {
    text-align: center !important;
    font-family: Monaco, Courier, monospace !important;
    font-weight: 600 !important;
    padding: 0.01in !important;
    line-height: 1 !important;
  }
  
  .key span:first-child {
    background: #f0f0f0 !important;
    color: black !important;
    border-bottom: 1px solid black !important;
    font-size: 5pt !important;
    text-transform: uppercase !important;
    height: 0.08in !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .key span.gen {
    background: white !important;
    color: black !important;
    border: 1px solid black !important;
    font-size: 6pt !important;
    font-weight: bold !important;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .key-spacebar span.gen {
    font-size: 5pt !important;
    letter-spacing: 0.5pt !important;
  }
  
  /* Seed info */
  .card::after {
    content: "Seed: " attr(data-seed);
    position: absolute;
    bottom: 0.02in;
    left: 0.05in;
    font-size: 4pt;
    color: #666;
    font-family: Monaco, Courier, monospace;
  }
}

/* Dark Theme */
body.dark {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  color: #e2e8f0;
}

body.dark .header {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

body.dark .card {
  background: #1a1a1a;
  border-color: #374151;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark .card-header {
  border-bottom-color: #dc2626;
}

body.dark .key {
  background: #2d2d2d;
  border-color: #374151;
}

body.dark .key:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

body.dark .key span:first-child {
  background: #374151;
  color: #e2e8f0;
  border-bottom-color: #4b5563;
}

body.dark .main-controls {
  background: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark .secondary-btn {
  background: #1a1a1a;
  color: #e2e8f0;
  border-color: #374151;
}

body.dark .secondary-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
}

body.dark .settings-btn {
  background: #2d2d2d;
  border-color: #374151;
  color: #e2e8f0;
}

body.dark .settings-btn:hover {
  background: #374151;
  border-color: #4b5563;
}

body.dark .seed-input-section {
  background: #2d2d2d;
  border-color: #374151;
}

body.dark .seed-input-group input {
  background: #1a1a1a;
  border-color: #374151;
  color: #e2e8f0;
}

body.dark .seed-input-group input:focus {
  border-color: #dc2626;
  background: #2d2d2d;
}

body.dark .card-settings {
  background: #1a1a1a;
  border-color: #374151;
}

body.dark .settings-header {
  border-bottom-color: #dc2626;
}

body.dark .settings-header h3 {
  color: #e2e8f0;
}

body.dark .card-settings h4 {
  color: #e2e8f0;
}

body.dark .row label {
  color: #9ca3af;
}

body.dark input[type="text"] {
  background: #2d2d2d;
  border-color: #374151;
  color: #e2e8f0;
}

body.dark input[type="text"]:focus {
  background: #374151;
}

body.dark .current-seed-display input {
  background: #2d2d2d;
  border-color: #374151;
  color: #9ca3af;
}

body.dark .instructions {
  background: #1a1a1a;
  border-color: #374151;
}

body.dark .instructions h2 {
  color: #e2e8f0;
}

body.dark .instructions p {
  color: #9ca3af;
}

body.dark .warning-callout {
  background: #2a1515;
  border-color: #7f1d1d;
}

body.dark .warning-text {
  color: #fca5a5;
}

body.dark code {
  background: #2d2d2d;
  border-color: #374151;
}

body.dark code input {
  background: #1a1a1a;
  border-color: #374151;
  color: #e2e8f0;
}

body.dark .instructions li::before {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

body.dark .close-btn:hover {
  background: #2d2d2d;
}

body.dark #theme-toggle {
  background: #fbbf24;
  color: #92400e;
  border-color: #f59e0b;
}

body.dark #theme-toggle:hover {
  background: #f59e0b;
  border-color: #d97706;
}