*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; */
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #050814;
  color: #f9fafb;
}

/* main layout wrapper */

.page-wrapper {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 16px 60px;
}

/* generic card */

.card {
  background: #111827;
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

/* header panel */

.header-panel {
  text-align: center;
  margin-bottom: 32px;
}

.app-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.02em;
}

.app-subtitle {
  margin: 8px 0 22px;
  color: #d1d5db;
  font-size: 14px;
  padding: 16px 32px;  
  font-size: 18px;   
  font-weight: 600;    
  border-radius: 12px; 
}

/* list panel */

.list-panel {
  margin-top: 4px;
}

/* buttons */

button,
.btn {
  padding: 10px 22px;
  border-radius: 12px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

/* Primary (Add Workout, Save) */
.btn-primary {
  background: #3a8bff;
  color: white;
  padding: 16px 32px;  
  font-size: 18px;   
  font-weight: 600;    
  border-radius: 12px; 
}

.btn-primary:hover {
  background: #1f6fe0;
}

.btn-green {
  background: #3bb273;
  color: white;
}

.btn-green:hover {
  background: #2e8d59;
}

/* Delete button */
.btn-red {
  background: #d9534f;
  color: white;
}

.btn-red:hover {
  background: #b63f3c;
}

/* Cancel button */
.btn-gray {
  background: #6c757d;
  color: white;
}

.btn-gray:hover {
  background: #565e64;
}

/* Workout list / Card */

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.workout-card {
  background: #0f172a;
  border-radius: 16px;
  padding: 28px 30px;
  grid-template-columns: 110px 1fr;
  align-items: center;
  display: flex;
  align-items: flex-start;
  gap: 50px;

}

.workout-card {
  display: flex;
  align-items: flex-start;
  gap: 50px;
  padding: 28px 30px;
  background: #1a2335;
}

.workout-thumb {
  width: 200px;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.workout-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workout-body {
  max-width: 700px;
}

.workout-body h3 {
  margin-bottom: 14px;
}

.workout-meta {
  margin-bottom: 18px;
  display: flex;
  gap: 40px;       
  flex-wrap: wrap;
}

.workout-body .description {
  margin-bottom: 25px;
  line-height: 1.6;
}

.workout-actions {
  display: flex;
  gap: 20px;
}

.meta {
  margin: 0 0 10px;
  font-size: 16px;    
  color: #d1d5db;
  display: flex;
  gap: 20px;            
}

.meta span + span {
  margin-left: 20px;    
}

.description {
  margin-bottom: 20px;
}

.empty-state {
  margin: 6px 0 2px;
  font-size: 16px;
  color: #9ca3af;
}

/* Forms (Add / Edit) */

.form-card {
  margin-top: 16px;
}

.form-title {
  margin: 0 0 20px;
  font-size: 26px;
}

.form-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
}

/* Left column image */

.form-image-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-right: 30px;
}

.image-frame {
  width: 220px;
  height: 320px;
  border-radius: 12px;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* Right column form */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.full-width {
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
  color: #e5e7eb;
}

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 9px 11px;
  background: #020617;
  color: #f9fafb;
  font-size: 14px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

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

.form-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

/* Delete Confirmation Box/Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #f9fafb;
  color: #111827;
  padding: 24px 26px 20px;
  border-radius: 14px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.8);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.modal p {
  margin: 0 0 18px;
  font-size: 14px;
  color: #4b5563;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive adjustments */

@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-image-col {
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .workout-card {
    grid-template-columns: 1fr;
  }

  .workout-thumb,
  .workout-thumb img {
    width: 100%;
    max-width: 230px;
    margin: 0 auto;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .page-wrapper {
    margin-top: 24px;
  }
}

.image-preview {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #2d3542;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 12px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

.preview-placeholder {
  display: flex;
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
  text-align: center;
  width: 100%;
  height: 100%;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #cfd3dd;
}
