/* ===================================
   RxTestify - Main Styles
   =================================== */

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

:root {
  --primary: #1B2B4B;
  --primary-dark: #162240;
  --secondary: #3B5998;
  --accent: #546E7A;
  --success: #0D7377;
  --warning: #fbbf24;
  --error: #C0392B;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-light: #F5F7FA;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background: var(--bg-light);
}

/* ===================================
   Header Styles
   =================================== */

header {
  background: #1B2B4B;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: none;
  align-items: center;
  gap: 1rem; /* 16px — name→button and button→button spacing */
}

.user-info.visible {
  display: flex;
}

/* Shared navbar button sizing across all pages */
.user-info .btn {
  padding: 0.625rem 1.25rem; /* 10px 20px */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
}

/* ===================================
   Button Styles
   =================================== */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
}

.btn-primary {
  background: white;
  color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background: #f0f2f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-success {
  background: #0D7377;
  color: white;
}

.btn-success:hover {
  background: #0b666a;
}

.btn-danger {
  background: #C0392B;
  color: white;
}

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

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

.btn-error {
  background: white;
  color: #C0392B;
  border: 1px solid #C0392B;
}

.btn-error:hover {
  background: #C0392B;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ===================================
   Action Button Classes (document table)
   =================================== */

.btn-view {
  background: #3B5998;
  color: white;
}

.btn-view:hover {
  background: #354e89;
}

.btn-process {
  background: #0A5C60;
  color: white;
}

.btn-process:hover {
  background: #095357;
}

.btn-suite {
  background: #4A5568;
  color: white;
}

.btn-suite:hover {
  background: #434e5e;
}

.btn-history {
  background: #546E7A;
  color: white;
}

.btn-history:hover {
  background: #4c636e;
}

/* ===================================
   Card Styles
   =================================== */

.card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.card-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ===================================
   Form Styles
   =================================== */

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

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

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ===================================
   Status Badges
   =================================== */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-uploaded {
  background: #dbeafe;
  color: #1e40af;
}

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

.badge-completed {
  background: #d1fae5;
  color: #065f46;
}

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

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

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

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

/* ===================================
   Table Styles
   =================================== */

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: #eef1f6;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:nth-child(odd) {
  background: #ffffff;
}

tbody tr:nth-child(even) {
  background: #F5F7FA;
}

tr:hover {
  background: #eaecf0 !important;
}

/* ===================================
   Loading & Progress
   =================================== */

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--secondary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: var(--border-color);
}

progress::-webkit-progress-value {
  background: var(--secondary);
}

/* ===================================
   Alert/Message Styles
   =================================== */

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #C0392B;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

/* ===================================
   Footer Styles
   =================================== */

footer {
  background: var(--text-dark);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

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

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  margin: 0 1rem;
  opacity: 0.8;
  transition: opacity 0.3s;
}

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

.claude-notice {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===================================
   Utility Classes
   =================================== */

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

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .user-info {
    flex-direction: column;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}
