/* Admin panel and form styles */

/* Header styles */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

header .header-content {
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

header h1 {
  margin: 0;
  font-size: 24px;
}

header h1 a,
header h1 a:link,
header h1 a:visited,
header h1 a:active {
  color: #fff !important;
  text-decoration: none;
}

header h1 a:hover {
  opacity: 0.9;
  color: #fff !important;
}

/* Menu separator */
.menu-separator {
  border-top: 1px dotted #ccc;
  margin: 10px 0;
}

/* Admin page titles */
.main-content > h2 {
  font-family: 'Comfortaa', 'Quicksand', sans-serif;
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px dotted #ddd;
}

/* Admin form wide for WYSIWYG */
.admin-form-wide {
  max-width: 100%;
}

/* Alerts */
.alert {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert p {
  margin: 5px 0;
}

/* Forms */
.auth-form,
.admin-form {
  max-width: 500px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #fa5b4d;
  box-shadow: 0 0 0 2px rgba(250, 91, 77, 0.2);
}

.form-group input:disabled {
  background: #eee;
  color: #666;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-group.half {
  flex: 1;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  width: auto;
}

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

.form-help {
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary,
.btn-primary:link,
.btn-primary:visited {
  background: #fa5b4d;
  color: #fff !important;
}

.btn-primary:hover {
  background: #e04a3d;
  color: #fff !important;
}

.btn-secondary,
.btn-secondary:link,
.btn-secondary:visited {
  background: #6c757d;
  color: #fff !important;
}

.btn-secondary:hover {
  background: #5a6268;
  color: #fff !important;
}

.btn-warning,
.btn-warning:link,
.btn-warning:visited {
  background: #ffc107;
  color: #212529 !important;
}

.btn-warning:hover {
  background: #e0a800;
  color: #212529 !important;
}

.btn-danger,
.btn-danger:link,
.btn-danger:visited {
  background: #dc3545;
  color: #fff !important;
}

.btn-danger:hover {
  background: #c82333;
  color: #fff !important;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-tiny {
  padding: 2px 6px;
  font-size: 11px;
  background: #e9ecef;
  color: #333 !important;
  border: 1px solid #ccc;
}

.btn-tiny:hover {
  background: #dee2e6;
}

/* Order cell with buttons */
.order-cell {
  white-space: nowrap;
}

.order-buttons {
  display: inline-block;
  margin-left: 5px;
}

.order-buttons form {
  display: inline;
}

/* Profile sections */
.profile-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eee;
}

.profile-section:last-child {
  border-bottom: none;
}

.profile-section h3 {
  margin-bottom: 20px;
  color: #333;
}

/* Admin dashboard */
.admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 36px;
  font-weight: bold;
  color: #fa5b4d;
}

.stat-icon {
  font-size: 36px;
}

.stat-label {
  color: #666;
  margin: 10px 0;
}

.stat-link {
  font-size: 14px;
  color: #fa5b4d;
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: underline;
}

.admin-quick-actions {
  margin-top: 30px;
}

.admin-quick-actions h3 {
  margin-bottom: 15px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Admin tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

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

.admin-table th {
  background: #f5f5f5;
  font-weight: bold;
  color: #333;
}

.admin-table tr:hover {
  background: #fafafa;
}

.admin-table code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.admin-table .actions {
  white-space: nowrap;
}

.admin-table .actions form {
  display: inline;
}

/* Admin header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-header h2 {
  margin: 0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-secondary {
  background: #e9ecef;
  color: #6c757d;
}

/* Inline forms */
.inline-form {
  display: inline;
  margin-left: 5px;
}

/* Empty state */
.empty-message {
  padding: 40px;
  text-align: center;
  color: #666;
  background: #f9f9f9;
  border-radius: 8px;
}

/* Input with prefix */
.input-with-prefix {
  display: flex;
  align-items: stretch;
}

.input-with-prefix .prefix {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 10px 12px;
  color: #666;
  font-size: 14px;
}

.input-with-prefix input {
  border-radius: 0 4px 4px 0 !important;
  flex: 1;
}

/* Page content */
.page-content {
  line-height: 1.8;
}

.page-content p {
  margin-bottom: 15px;
}

.page-content h1,
.page-content h2,
.page-content h3 {
  margin: 20px 0 10px;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  header .header-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .admin-stats {
    flex-direction: column;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .admin-table {
    font-size: 12px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 8px 5px;
  }
}

/* Icon picker */
.icon-preview {
  width: 50px;
  height: 38px;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  font-size: 20px;
  color: #555;
}

.icon-preview .no-icon {
  font-size: 11px;
  color: #999;
}

.icon-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.icon-picker-content {
  background: #fff;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.icon-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.icon-picker-header h3 {
  margin: 0;
  font-size: 18px;
}

.icon-picker-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.icon-picker-close:hover {
  color: #333;
}

.icon-picker-search {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.icon-picker-search input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 15px 20px;
  overflow-y: auto;
  max-height: 300px;
}

.icon-picker-item {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  color: #555;
  transition: all 0.2s;
}

.icon-picker-item:hover {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.icon-picker-actions {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

@media (max-width: 480px) {
  .icon-picker-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
