:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #0e9f6e;
  --border: #d1d5db;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(1200px 600px at 0% -10%, #e5f6f2 0%, rgba(229, 246, 242, 0) 60%),
    radial-gradient(900px 420px at 100% 0%, #eef4ff 0%, rgba(238, 244, 255, 0) 58%),
    linear-gradient(180deg, #edf2f9 0%, var(--bg) 100%);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

header h1 {
  margin-bottom: 0.25rem;
}

header p {
  margin-top: 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.ribbon-card {
  background: linear-gradient(135deg, #f8fcfb 0%, #f5f9ff 100%);
  border: 1px solid #d5e4ea;
  border-radius: 12px;
  height: 76px;
  overflow: hidden;
  position: relative;
}

.ribbon-title {
  position: absolute;
  left: 0.85rem;
  top: 0.6rem;
  z-index: 2;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2937;
}

.ribbon-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ribbon-wave path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.6;
}

.ribbon-wave path:nth-child(1) {
  stroke: rgba(15, 118, 110, 0.5);
}

.ribbon-wave path:nth-child(2) {
  stroke: rgba(37, 99, 235, 0.44);
}

.ribbon-wave path:nth-child(3) {
  stroke: rgba(14, 159, 110, 0.34);
}

h2 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.95rem;
  min-width: 0;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.actions,
.timer-row {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

button {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.video-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.video-link.disabled {
  color: var(--muted);
  pointer-events: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.time {
  font-size: 1.4rem;
  font-weight: 700;
}

.label,
.muted {
  color: var(--muted);
}

.history-list {
  display: grid;
  gap: 0.75rem;
}

.history-footer-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.deployment-info {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.03) 0%, rgba(14, 159, 110, 0.03) 100%);
}

.deploy-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-label {
  color: var(--muted, #666);
  font-weight: 600;
}

#commit-badge {
  color: #0369a1;
  text-decoration: none;
  padding: 1px 5px;
  background: #e0f2fe;
  border-radius: 3px;
}

#commit-badge:hover { background: #bae6fd; }

.badge-status {
  padding: 1px 5px;
  border-radius: 3px;
}

.status-success { color: #166534; background: #dcfce7; }
.status-failed  { color: #991b1b; background: #fee2e2; }
.status-running { color: #854d0e; background: #fef9c3; }
.status-unknown { color: #374151; background: #f3f4f6; }

.history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #fcfdfd;
}

.history-item h3 {
  margin: 0 0 0.45rem;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}

.delete-history-btn {
  background: #b91c1c;
}

ul {
  margin: 0;
  padding-left: 1.15rem;
}

.remove-btn {
  background: #b91c1c;
}

@media (max-width: 720px) {
  .container {
    padding: 0.8rem;
  }

  .card {
    padding: 0.75rem;
  }

  .history-footer-actions {
    justify-content: center;
  }

  .deploy-badges {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  #exportCsvBtn {
    order: 1;
  }
}

/* New Project Tracker Styles */
.language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.language-selector label {
  font-weight: 600;
  color: var(--text);
}

.language-selector select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.project-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.project-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.project-summary h3 {
  margin: 0 0 0.75rem 0;
  color: var(--accent);
}

.project-summary p {
  margin: 0.25rem 0;
}

.project-list {
  display: grid;
  gap: 1rem;
}

.project-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.project-item h3 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}

.project-item p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.project-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.full-width {
  grid-column: 1 / -1;
}

/* Form validation styles */
input:invalid {
  border-color: #dc2626;
}

/* File upload styles */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-area:hover {
  border-color: var(--accent);
  background: #f0f9ff;
}

.file-upload-area.dragover {
  border-color: var(--accent);
  background: #e0f2fe;
}

.file-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-item-actions {
  display: flex;
  gap: 0.25rem;
}

/* Status badges */
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-planning {
  background: #fef3c7;
  color: #92400e;
}

.status-in-progress {
  background: #dbeafe;
  color: #1e40af;
}

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

.status-on-hold {
  background: #fed7aa;
  color: #9a3412;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}
