:root {
  --primary-color: #eb3505;
  --primary-dark: #d43004;
  --secondary-color: #1e293b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --text-color: #475569;
  --border-color: #e2e8f0;
  --bg-light: #f8fafc;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
  background: var(--bg-light);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: clamp(14px, 1.5vw, 16px);
}

.public-view-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 2vw, 20px);
}

.page-header {
  margin-bottom: clamp(24px, 3vw, 32px);
  background: var(--white);
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3.5vw, 32px);
  border-radius: clamp(12px, 1.5vw, 16px);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.header-top {
  margin-bottom: clamp(16px, 2.5vw, 24px);
  padding-bottom: clamp(14px, 2vw, 20px);
  border-bottom: 2px solid var(--border-color);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1vw, 10px);
  padding: clamp(8px, 1.2vw, 10px) clamp(16px, 2vw, 20px);
  background: var(--bg-light);
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  width: fit-content;
  font-size: clamp(13px, 1.4vw, 14px);
  border-radius: 8px;
}

.back-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  transform: translateX(-4px);
}

.back-btn i {
  font-size: clamp(12px, 1.3vw, 14px);
  transition: transform 0.3s ease;
}

.back-btn:hover i {
  transform: translateX(-3px);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(16px, 2.5vw, 24px);
  flex-wrap: wrap;
}

.header-info {
  flex: 1;
  min-width: clamp(200px, 30vw, 280px);
}

.page-title {
  font-size: clamp(20px, 3.5vw, 32px);
  color: var(--secondary-color);
  font-weight: 800;
  margin-bottom: clamp(6px, 1vw, 8px);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 12px);
  line-height: 1.2;
}

.page-title::before {
  content: "";
  width: 5px;
  height: clamp(24px, 3vw, 32px);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border-radius: 3px;
  flex-shrink: 0;
}

.page-subtitle {
  font-size: clamp(12px, 1.4vw, 15px);
  color: var(--text-color);
  margin: 0;
  font-weight: 500;
  padding-left: clamp(13px, 1.8vw, 17px);
  line-height: 1.4;
}

.contract-id-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 0.8vw, 8px);
  padding: clamp(12px, 1.8vw, 16px) clamp(20px, 3vw, 28px);
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-radius: clamp(10px, 1.2vw, 12px);
  border: 2px solid rgba(235, 53, 5, 0.2);
  box-shadow: 0 4px 12px rgba(235, 53, 5, 0.15);
  min-width: clamp(160px, 22vw, 200px);
  transition: all 0.3s ease;
}

.contract-id-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 53, 5, 0.25);
  border-color: rgba(235, 53, 5, 0.4);
}

.id-label {
  font-size: clamp(10px, 1.1vw, 11px);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.id-value {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--primary-color);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-align: center;
  word-break: break-word;
}

/* Status Overview */
.status-overview {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(clamp(200px, 25vw, 250px), 1fr)
  );
  gap: clamp(16px, 2vw, 20px);
  margin-bottom: clamp(24px, 3vw, 32px);
}

.status-item {
  background: var(--white);
  padding: clamp(18px, 2.5vw, 24px);
  border-radius: clamp(10px, 1.2vw, 12px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.status-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.status-icon {
  width: clamp(48px, 6vw, 60px);
  height: clamp(48px, 6vw, 60px);
  border-radius: clamp(10px, 1.2vw, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 2.5vw, 24px);
  color: var(--white);
  flex-shrink: 0;
}

.status-icon.notyetstarted {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.status-icon.ongoing {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.status-icon.suspended {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.status-icon.completed {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.status-icon.terminated {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.status-icon.progress {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.status-icon.cost {
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
}

.status-icon.duration {
  background: linear-gradient(135deg, #ec4899, #f472b6);
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  font-size: clamp(11px, 1.3vw, 13px);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--secondary-color);
  font-weight: 800;
  word-break: break-word;
}

/* Progress Section */
.progress-section {
  background: var(--white);
  padding: clamp(20px, 3vw, 28px);
  border-radius: clamp(10px, 1.2vw, 12px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: clamp(24px, 3vw, 32px);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 1.8vw, 16px);
  gap: 12px;
  flex-wrap: wrap;
}

.progress-header h3 {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--secondary-color);
  font-weight: 700;
  margin: 0;
}

.progress-percentage {
  font-size: clamp(20px, 2.8vw, 24px);
  color: var(--success-color);
  font-weight: 800;
}

.progress-bar-wrapper {
  height: clamp(14px, 1.8vw, 16px);
  background: var(--bg-light);
  border-radius: clamp(10px, 1.2vw, 12px);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), #34d399);
  border-radius: 12px;
  transition: width 0.6s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, clamp(320px, 40vw, 450px)), 1fr)
  );
  gap: clamp(18px, 2.5vw, 24px);
}

.detail-card {
  background: var(--white);
  padding: clamp(20px, 3vw, 28px);
  border-radius: clamp(10px, 1.2vw, 12px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.detail-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(235, 53, 5, 0.3);
}

.card-title {
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: clamp(18px, 2.5vw, 24px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 12px);
  padding-bottom: clamp(12px, 1.8vw, 16px);
  border-bottom: 2px solid var(--border-color);
}

.card-title i {
  width: clamp(36px, 4.5vw, 40px);
  height: clamp(36px, 4.5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: var(--white);
  border-radius: clamp(8px, 1vw, 10px);
  font-size: clamp(16px, 2vw, 18px);
  flex-shrink: 0;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 8px);
  padding: clamp(12px, 1.8vw, 16px) 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-item:first-of-type {
  padding-top: 0;
}

.detail-label {
  font-size: clamp(11px, 1.3vw, 13px);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: clamp(14px, 1.7vw, 16px);
  color: var(--secondary-color);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.5;
}

.detail-value.highlight {
  color: var(--primary-color);
  font-size: clamp(18px, 2.2vw, 20px);
  font-weight: 800;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: clamp(6px, 0.8vw, 8px) clamp(12px, 1.8vw, 16px);
  border-radius: 25px;
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-notyetstarted {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status-ongoing {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.status-suspended {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #7c2d12;
  border: 1px solid #f87171;
}

.status-completed {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.status-terminated {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.text-danger {
  color: var(--danger-color);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 1024px) {
  .public-view-container {
    padding: clamp(16px, 3vw, 24px) clamp(12px, 1.5vw, 16px);
  }

  .status-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .details-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }
}

@media (max-width: 768px) {
  .public-view-container {
    padding: 20px 16px;
  }

  .page-header {
    padding: 20px;
  }

  .header-top {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .back-btn {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 10px 16px;
  }

  .header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-info {
    text-align: center;
    min-width: auto;
  }

  .page-title {
    font-size: 22px;
    justify-content: center;
  }

  .page-title::before {
    display: none;
  }

  .page-subtitle {
    padding-left: 0;
    font-size: 13px;
  }

  .contract-id-badge {
    width: 100%;
    min-width: auto;
  }

  .status-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .status-item {
    padding: 18px;
  }

  .status-icon {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  .status-label {
    font-size: 11px;
  }

  .status-value {
    font-size: 18px;
  }

  .progress-section {
    padding: 20px;
  }

  .progress-header h3 {
    font-size: 16px;
  }

  .progress-percentage {
    font-size: 20px;
  }

  .progress-bar-wrapper {
    height: 14px;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-card {
    padding: 20px;
  }

  .card-title {
    font-size: 16px;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  .card-title i {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .detail-item {
    padding: 12px 0;
  }

  .detail-label {
    font-size: 11px;
  }

  .detail-value {
    font-size: 14px;
  }

  .detail-value.highlight {
    font-size: 18px;
  }
}

@media (max-width: 576px) {
  .page-header {
    padding: 16px;
  }

  .back-btn {
    font-size: 12px;
    padding: 8px 14px;
    gap: 6px;
  }

  .back-btn i {
    font-size: 11px;
  }

  .page-title {
    font-size: 20px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .contract-id-badge {
    padding: 12px 18px;
  }

  .id-label {
    font-size: 9px;
  }

  .id-value {
    font-size: 16px;
  }

  .status-overview {
    grid-template-columns: 1fr;
  }

  .status-item {
    padding: 16px;
    gap: 12px;
  }

  .status-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .status-label {
    font-size: 10px;
  }

  .status-value {
    font-size: 16px;
  }

  .progress-section {
    padding: 16px;
  }

  .progress-header {
    margin-bottom: 10px;
  }

  .progress-header h3 {
    font-size: 14px;
  }

  .progress-percentage {
    font-size: 18px;
  }

  .progress-bar-wrapper {
    height: 12px;
  }

  .detail-card {
    padding: 16px;
  }

  .card-title {
    font-size: 14px;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .card-title i {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .detail-item {
    padding: 10px 0;
    gap: 6px;
  }

  .detail-label {
    font-size: 10px;
  }

  .detail-value {
    font-size: 13px;
  }

  .detail-value.highlight {
    font-size: 16px;
  }

  .status-badge {
    font-size: 9px;
    padding: 5px 10px;
  }
}

@media (max-width: 390px) {
  .public-view-container {
    padding: 16px 12px;
  }

  .page-title {
    font-size: 18px;
  }

  .id-value {
    font-size: 14px;
  }

  .status-value {
    font-size: 14px;
  }

  .detail-value {
    font-size: 12px;
  }
}
