/* NotebookLM Crawler - Styles */

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fc;
  color: #1a1a2e;
  line-height: 1.6;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #d9700f;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

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

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

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

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

.btn-large {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

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

.link-button {
  background: none;
  border: none;
  color: #1d4ed8;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #374151;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #F6821F;
  box-shadow: 0 0 0 3px rgba(246, 130, 31, 0.1);
}

.form-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #003682 0%, #1e3a5f 100%);
}

.auth-card {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header svg {
  margin-bottom: 1rem;
}

.auth-header h1 {
  color: #1e293b;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: #64748b;
  font-size: 0.9rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Navigation */
.navbar {
  background: #003682;
  color: white;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-bottom: 4px solid #F6821F;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-logo {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

.nav-user {
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* Main Content */
.main-content {
  padding: 2rem;
}

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

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 2.25rem;
  color: #1e293b;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card h3 {
  color: #003682;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.card p {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: #f8fafc;
}

.truncate {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-error {
  background: #fee2e2;
  color: #991b1b;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

/* Recent Crawls Section */
.recent-crawls {
  margin-top: 3rem;
}

.recent-crawls h2 {
  margin-bottom: 1rem;
  color: #1e293b;
}

.view-all {
  text-align: right;
  margin-top: 1rem;
}

/* Results Page */
.results-header {
  margin-bottom: 2rem;
}

.results-header h1 {
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #64748b;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #003682;
}

.stat-label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pages-list {
  margin-top: 2rem;
}

.pages-list h2 {
  margin-bottom: 1rem;
  color: #1e293b;
}

/* Crawl Form */
.crawl-form {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  max-width: 600px;
}

.info-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.info-box h3 {
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.info-box ul {
  margin-left: 1.25rem;
  color: #64748b;
}

.info-box li {
  margin: 0.5rem 0;
}

/* Status Page */
.status-container {
  text-align: center;
  padding: 4rem 2rem;
}

.status-spinner {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.status-url {
  color: #64748b;
  margin-bottom: 2rem;
  word-break: break-all;
}

.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  margin: 1.5rem auto;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #F6821F;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.status-count {
  color: #64748b;
  margin-bottom: 1rem;
}

.status-hint {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* History Table */
.history-table .cell-date {
  white-space: nowrap;
  font-size: 0.85rem;
}

.history-table .cell-user {
  font-weight: 500;
}

.history-table .cell-url {
  max-width: 300px;
}

.history-table .cell-actions {
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  color: #1e293b;
  margin-bottom: 0.5rem;
}

/* Error Messages */
.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .truncate {
    max-width: 150px;
  }
}
