/**
 * Common styles shared across all demo applications
 * Individual demos can override these with theme-specific styles
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  padding: 24px;
}

/* Demo container */
.demo-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Demo header */
.demo-header {
  background: white;
  color: #333;
  padding: 32px;
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.demo-header h1 {
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 8px;
}

.demo-header p {
  font-size: 16px;
  color: #666;
  margin-bottom: 16px;
}

/* Action buttons */
.action-buttons,
.demo-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.action-button,
.demo-button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-button:disabled,
.demo-button:disabled {
  background: #ccc !important;
  cursor: not-allowed;
}

.action-button.danger {
  background: #d32f2f;
}

.action-button.danger:hover {
  background: #b71c1c;
}

/* Status messages */
.status-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-message.error {
  background: #ffebee;
  color: #c62828;
}

.status-message.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-message.info {
  background: #e3f2fd;
  color: #1565c0;
}

.status-message.warning {
  background: #fff3e0;
  color: #e65100;
}

.status-message-text {
  flex: 1;
}

.status-message-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.status-message-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.status-message-close .material-icons {
  font-size: 18px;
}

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

/* Modal */
.modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.close-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-button:hover {
  background: #f0f0f0;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group label.required::after {
  content: ' *';
  color: #d32f2f;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  background-color: white;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color, #6200ee);
}

.form-select {
  cursor: pointer;
}

/* Help text */
.help-text {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Array fields */
.array-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.array-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

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

.btn-icon {
  padding: 8px;
  min-width: auto;
}

.btn .material-icons {
  font-size: 18px;
}

/* Modal footer */
.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-footer button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-footer button.primary {
  background: var(--primary-color, #6200ee);
  color: white;
}

.modal-footer button.primary:hover {
  background: var(--primary-color-dark, #4a00b8);
}

.modal-footer button.secondary {
  background: #f0f0f0;
  color: #333;
}

.modal-footer button.secondary:hover {
  background: #e0e0e0;
}

/* Field groups */
.field-group {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f9f9f9;
}

.field-group-title {
  font-weight: 500;
  color: var(--primary-color, #6200ee);
  margin-bottom: 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Demo grid */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.demo-panel {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.demo-panel h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-panel h2 .material-icons {
  color: var(--primary-color, #6200ee);
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mt-4 {
  margin-top: 32px;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.mb-3 {
  margin-bottom: 24px;
}
.mb-4 {
  margin-bottom: 32px;
}
