/* Professional Clean Design - Aparna Institutes CNE Registration */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1e3a8a;
  --primary-color: #1e3a8a; /* Alias for backward compatibility */
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --text-main: #111827;
  --text-light: #6b7280;
  --bg-body: #f3f4f6;
  --white: #ffffff;
  --border-color: #e5e7eb;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
}

/* Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.header h1 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 800;
}

.header h2 {
  color: var(--text-light);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.nav-links {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-btn {
  background: var(--bg-body);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

.nav-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Form Card */
.form-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  padding: 14px;
}

/* Alert Messages */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  font-weight: 500;
}

.alert.show {
  display: block;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

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

/* Loading Spinner */
.spinner {
  display: none;
  width: 40px;
  height: 40px;
  margin: 40px auto;
  border: 4px solid #e5e7eb;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.show {
  display: block;
}

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

/* Workshops Display */
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.workshop-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.workshop-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.workshop-top {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.workshop-body {
  padding: 20px;
}

.workshop-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
  line-height: 1.3;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-row:last-of-type {
  border-bottom: none;
}

.info-label {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
}

.info-value {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
}

.seats-bar-container {
  background: #e5e7eb;
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0 8px 0;
}

.seats-bar {
  height: 100%;
  background: linear-gradient(to right, var(--success), var(--accent));
  transition: width 0.3s ease;
  border-radius: 10px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

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

.status-completed {
  background: #f3f4f6;
  color: #6b7280;
}

/* Register Now Button */
.btn-register {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-register:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-register:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Form Section */
#formSection {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

#formSection.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f3f4f6;
}

.modal-header h2 {
  color: var(--primary);
  font-size: 1.5rem;
}

.modal-body {
  margin-bottom: 20px;
}

.disclaimer-box {
  background: #fef3c7;
  border-left: 4px solid var(--accent);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
}

.disclaimer-box strong {
  color: var(--danger);
  display: block;
  margin-bottom: 8px;
}

.review-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f3f4f6;
}

.review-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.review-item strong {
  display: block;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.review-item span {
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 500;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text-main);
}

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

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

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

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.flex-1 {
  flex: 1;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f9fafb;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: white;
}

/* Admin Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 1px solid #e5e7eb;
}

.stat-card h3 {
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}

.stat-card .value {
  color: var(--primary);
  font-size: 2.5rem;
  font-weight: 700;
}

.table-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  border: 1px solid #e5e7eb;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.search-box {
  padding: 10px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  min-width: 300px;
  font-size: 1rem;
}

.search-box:focus {
  outline: none;
  border-color: var(--primary);
}

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

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

table th {
  background: #f9fafb;
  color: var(--text-main);
  font-weight: 600;
  position: sticky;
  top: 0;
}

table tr:hover {
  background: #f9fafb;
}

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

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

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

/* Workshop Info Display */
.workshop-info-box {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
  border-left: 4px solid #2196f3;
}

.workshop-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.workshop-info-item strong {
  color: #1565c0;
  font-size: 0.9rem;
}

.workshop-info-item span {
  color: #0d47a1;
  font-size: 0.9rem;
  margin-left: 4px;
}

#workshopInfo .workshop-title {
  color: #0d47a1;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

#workshopInfo .workshop-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

#workshopInfo .workshop-meta span {
  color: #0d47a1;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 15px;
    margin-bottom: 15px;
  }

  .header h1 {
    font-size: 1.3rem;
  }

  .header h2 {
    font-size: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 8px;
  }

  .nav-btn {
    width: 100%;
    text-align: center;
    padding: 12px 15px;
  }

  .form-card {
    padding: 15px;
  }

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

  .workshop-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-box {
    min-width: 100%;
    width: 100%;
  }

  .modal-content {
    padding: 15px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer button {
    width: 100%;
  }

  /* Table responsive */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 0.8rem;
    min-width: 600px;
  }

  table th,
  table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  /* Form grid responsive */
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Buttons */
  .btn,
  button {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  /* Header actions */
  .header-actions {
    flex-direction: column;
  }

  .header-actions button,
  .header-actions a {
    width: 100%;
    text-align: center;
  }

  /* Action buttons in tables */
  .action-btns {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .action-btns button {
    width: 100%;
    font-size: 0.75rem;
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 8px;
  }

  .header {
    padding: 12px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-card .value {
    font-size: 1.5rem;
  }

  .stat-card .label {
    font-size: 0.8rem;
  }

  .workshop-name {
    font-size: 1rem;
  }

  .btn-register {
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  .form-card {
    padding: 12px;
  }

  .form-group label,
  .modern-label {
    font-size: 0.85rem;
  }

  .modern-input,
  input,
  select,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 10px 12px;
  }

  table {
    font-size: 0.7rem;
  }

  table th,
  table td {
    padding: 6px 4px;
  }

  .modal-content {
    padding: 12px;
    margin: 10px;
  }

  .modal-content h2,
  .modal-content h3 {
    font-size: 1.1rem;
  }
}