/* Portal Settings Page CSS */

.admin-container {
  min-height: 100vh;
  background: #0f0f1a;
  color: #f8fafc;
}

.admin-header {
  background: #1a1a2e;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-link {
  color: #818cf8;
  text-decoration: none;
  font-size: 0.9rem;
}

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

.admin-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.settings-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #818cf8;
  background: #16213e;
  border-bottom: 2px solid #4f46e5;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Settings Cards */
.settings-card {
  background: #16213e;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-card h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
  color: #f8fafc;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0d1b2a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 1rem;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #4f46e5;
}

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

.form-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Logo Upload */
.logo-upload {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-preview {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 2px solid #334155;
  object-fit: contain;
  background: #0d1b2a;
}

.upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Color Picker */
.color-picker-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.color-picker-group input[type="color"] {
  width: 50px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.color-hex {
  width: 120px;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0;
}

.toggle-label span:first-child {
  color: #f8fafc;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 48px;
  height: 26px;
  background: #0d1b2a;
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #64748b;
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-label input:checked + .toggle-switch {
  background: #4f46e5;
}

.toggle-label input:checked + .toggle-switch::after {
  left: 25px;
  background: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background: #3730a3;
}

.btn-secondary {
  background: #16213e;
  color: #f8fafc;
  border: 1px solid #334155;
}

.btn-secondary:hover {
  background: #1e2a4a;
}

.btn-outline {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

/* Items List */
.items-list {
  margin-bottom: 1rem;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #0d1b2a;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.list-item.inactive {
  opacity: 0.5;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.item-code {
  background: #4f46e5;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.item-icon {
  font-size: 1.5rem;
}

.item-name {
  font-weight: 500;
}

.item-detail {
  color: #64748b;
  font-size: 0.85rem;
}

.item-actions {
  display: flex;
  gap: 0.25rem;
}

.empty-text {
  color: #64748b;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Settings Actions */
.settings-actions {
  margin-top: 2rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 12px;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #334155;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.btn-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #334155;
}

.modal-footer .btn {
  flex: 1;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  background: #16213e;
  border-radius: 8px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: #10b981;
  color: white;
}

.toast.error {
  background: #ef4444;
  color: white;
}

/* Responsive */
@media (max-width: 600px) {
  .settings-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
  }
  
  .logo-upload {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .color-picker-group {
    flex-wrap: wrap;
  }
}
