/* styles.css - Application Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #1f2937;
}

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

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 28px;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* Search Bar */
.search-bar {
  background: white;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.filter-label {
  font-weight: 600;
  color: white;
}

.tag-filter {
  padding: 8px 16px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  color: #667eea;
}

.tag-filter:hover {
  background: #f3f4f6;
}

.tag-filter.active {
  background: #667eea;
  color: white;
}

.btn-clear-filters {
  padding: 8px 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
}

.btn-clear-filters:hover {
  background: #dc2626;
}

/* Stats */
#stats {
  color: white;
  font-weight: 500;
  margin-bottom: 10px;
  text-align: right;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.password-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.password-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.password-card.copied {
  animation: copyFlash 0.5s ease;
}

@keyframes copyFlash {
  0%, 100% { background: white; }
  50% { background: #d1fae5; }
}

.card-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #1f2937;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag {
  background: #e0e7ff;
  color: #667eea;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.card-metadata {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 12px;
  white-space: pre-line;
  line-height: 1.5;
}

.card-timestamp {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 15px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

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

.btn-success {
  background: #10b981;
  color: white;
}

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

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #1f2937;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  grid-column: 1 / -1;
}

.empty-state h2 {
  margin-bottom: 12px;
  color: #374151;
  font-size: 24px;
}

.empty-state p {
  color: #6b7280;
  font-size: 16px;
}

/* Onboarding Modal */
.onboarding-screen {
  text-align: center;
}

.onboarding-screen h2 {
  margin-bottom: 30px;
  color: #1f2937;
}

.onboarding-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.mnemonic-display {
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
  border: 2px solid #e5e7eb;
}

.mnemonic-words-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.mnemonic-word {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-number {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
}

.word-text {
  color: #1f2937;
  font-weight: 600;
  font-family: monospace;
}

.warning-box {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
}

.warning-box p {
  color: #92400e;
  font-weight: 500;
  line-height: 1.5;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: -100px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 2000;
  font-weight: 500;
  transition: bottom 0.3s ease;
  max-width: 400px;
}

.toast.show {
  bottom: 20px;
}

.toast-success {
  background: #10b981;
  color: white;
}

.toast-error {
  background: #ef4444;
  color: white;
}

.toast-warning {
  background: #f59e0b;
  color: white;
}

/* Loading Spinner */
.loading-spinner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-spinner p {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

/* Password Generator */
.password-generator {
  margin: 20px 0;
}

.generated-password-display {
  position: relative;
  margin-bottom: 20px;
}

.generated-password-display input {
  padding-right: 50px;
  font-family: monospace;
  font-size: 16px;
}

.password-options {
  display: grid;
  gap: 12px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-row input[type="checkbox"] {
  width: auto;
}

.option-row input[type="range"] {
  flex: 1;
}

.strength-indicator {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  margin: 10px 0;
  transition: background 0.3s;
}

.strength-text {
  font-weight: 600;
  text-align: center;
}

/* User Info */
#userInfo {
  display: none;
  color: #6b7280;
  font-size: 14px;
}

#googleSignOutButton {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .mnemonic-words-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .header h1 {
    font-size: 22px;
  }

  .mnemonic-words-grid {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
  }

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

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
  display: none;
}
