/* fontgen.ai - Funky UI for Graphic Designers */

/* CSS Variables for theming */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #f472b6;
  --accent-dark: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e1b4b;
  --dark-soft: #312e81;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-accent: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --gradient-dark: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  background: var(--gradient-dark);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

header h1 .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header nav {
  display: flex;
  gap: 8px;
}

header nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

header nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

header nav a.active {
  opacity: 1;
  background: var(--primary);
}

/* Main Content */
main {
  padding: 32px 0;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 16px;
}

/* Font Type Selector - Big Choice Cards */
.font-type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.font-type-card {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.font-type-card:hover {
  border-color: var(--primary-light);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.font-type-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.font-type-card .icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.font-type-card .title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}

.font-type-card .description {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

.font-type-card input[type="radio"] {
  display: none;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-700);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-500);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* Reference Areas - Side by Side */
.reference-areas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .reference-areas {
    grid-template-columns: 1fr;
  }
  .font-type-selector {
    grid-template-columns: 1fr;
  }
}

/* Drop Zones */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--gray-100);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.drop-zone .icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.drop-zone p {
  color: var(--gray-500);
  font-size: 14px;
  margin: 4px 0;
}

.drop-zone p.hint {
  font-size: 12px;
  color: var(--gray-400);
}

.drop-zone input {
  display: none;
}

/* Drop Zone Preview */
.drop-zone .preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  width: 100%;
}

.drop-zone .preview-item {
  position: relative;
  background: white;
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.drop-zone .preview-item img {
  max-width: 80px;
  max-height: 80px;
  border-radius: 4px;
}

.drop-zone .preview-item .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

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

.btn-success:hover {
  background: #059669;
}

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

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Progress Modal */
.progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.progress-modal.active {
  opacity: 1;
  visibility: visible;
}

.progress-modal .modal-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.progress-modal.active .modal-content {
  transform: scale(1);
}

.progress-modal h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}

.progress-modal .status-text {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 24px;
}

.progress-modal .progress-bar-container {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-modal .progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-modal .progress-percent {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

/* Sheet Preview */
.sheet-preview {
  background: #808080;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}

.sheet-preview img {
  max-width: 100%;
  border-radius: var(--radius);
}

.sheet-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  background: var(--gray-100);
  border-radius: var(--radius);
}

/* Preview Box */
.preview-box {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 120px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
  gap: 4px;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
  color: var(--gray-500);
  transition: all 0.2s ease;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Font Grid (My Fonts page) */
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.font-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

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

.font-card .preview {
  height: 140px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--gray-700);
}

.font-card .info {
  padding: 16px;
}

.font-card .info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.font-card .info p {
  font-size: 13px;
  color: var(--gray-500);
}

.font-card .actions {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
}

/* Status Badges */
.status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-processing {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}

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

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

/* Prompt Suggestions (separate page) */
.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.suggestion-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s ease;
}

.suggestion-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

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

.suggestion-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
}

.suggestion-text {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
  font-style: italic;
}

.category-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  margin: 20px 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.use-prompt-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.use-prompt-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Kerning & Glyph Grid */
#kerningList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.kern-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kern-card:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--primary-light);
}

#glyphGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.glyph-cell {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.glyph-cell:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--primary-light);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

/* Link to prompts */
.prompts-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.prompts-link:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* Tool buttons for editor */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.tool-btn .icon {
  font-size: 14px;
}

/* Progress bar standard */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

/* Range inputs */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Animation for loading */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 2s ease-in-out infinite;
}

/* Radio group styling */
.radio-group {
  display: flex;
  gap: 20px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

/* Generation method toggle */
.method-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.method-toggle label {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.method-toggle input[type="radio"] {
  display: none;
}

.method-toggle input[type="radio"]:checked + span {
  background: white;
  box-shadow: var(--shadow-sm);
}

.method-toggle label span {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

/* Auth Pages */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
}

.auth-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 28px;
  font-size: 15px;
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form .form-group label {
  font-size: 13px;
  margin-bottom: 6px;
}

.auth-form .form-group label .optional {
  color: var(--gray-400);
  font-weight: 400;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.auth-divider span {
  padding: 0 16px;
  color: var(--gray-400);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-google {
  width: 100%;
  background: white;
  border: 2px solid var(--gray-200);
  color: var(--gray-700);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-google:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.btn-google svg {
  flex-shrink: 0;
}

.btn-block {
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--gray-500);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

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

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.btn-logout {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-login {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-login:hover {
  background: var(--primary-dark);
}
