/* components/Settings/Settings.css */
#settingsView .main-content {
  padding: 0 20px 20px 20px;
}

.settings-header {
  margin-bottom: 25px;
  text-align: center;
}

.settings-header h1 {
  font-size: 1.5rem;
  color: #009640;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.settings-header p {
  color: #6b7280;
  margin: 0;
  font-size: 1rem;
}

.settings-nav {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 15px 0;
  margin-bottom: 20px;
  scrollbar-width: thin;
  -ms-overflow-style: none;
}

.settings-nav::-webkit-scrollbar {
  height: 6px;
}

.settings-nav::-webkit-scrollbar-thumb {
  background-color: #009640;
  border-radius: 3px;
}

.settings-nav::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 3px;
}

.settings-nav-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 150, 64, 0.2);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #009640;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.3s ease;
  min-height: 40px;
}

.settings-nav-btn:hover {
  background: rgba(0, 150, 64, 0.1);
}

.settings-nav-btn.active {
  background: #009640;
  color: white;
  border-color: #009640;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.settings-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.section-header {
  padding: 20px 25px 15px 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h3 {
  margin: 0;
  color: #009640;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-actions {
  display: flex;
  gap: 10px;
}

.section-content {
  padding: 20px 25px;
}

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #009640;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.1);
}

.form-help-text {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 5px 0 15px 0;
  line-height: 1.4;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}

.permission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.permission-item:last-child {
  border-bottom: none;
}

.permission-info h4 {
  margin: 0 0 5px 0;
  color: #111827;
  font-size: 1rem;
}

.permission-info p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #009640;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.sync-status {
  background: rgba(0, 150, 64, 0.05);
  border-radius: 14px;
  padding: 15px;
  margin: 20px 0;
  border: 1px solid rgba(0, 150, 64, 0.1);
}

.status-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.status-item:last-child {
  margin-bottom: 0;
}

.status-item span:first-child {
  font-weight: 600;
  color: #374151;
}

.status-success {
  color: #10b981;
  font-weight: 600;
}

.status-warning {
  color: #f59e0b;
  font-weight: 600;
}

.status-error {
  color: #ef4444;
  font-weight: 600;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.15);
}

.logo-upload {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(0, 150, 64, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #009640;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed rgba(0, 150, 64, 0.3);
  transition: all 0.3s ease;
}

.logo-preview:hover {
  background: rgba(0, 150, 64, 0.15);
  border-color: rgba(0, 150, 64, 0.5);
}

.logo-preview i {
  font-size: 24px;
  margin-bottom: 5px;
}

.field-validation {
  color: #ef4444;
  font-size: 14px;
  margin-top: 5px;
  min-height: 20px;
}

.field-validation.success {
  color: #10b981;
}

/* Settings footer with save button */
.settings-footer {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.btn-primary {
  padding: 14px 28px;
  background: linear-gradient(135deg, #009640, #10b981);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 6px rgba(0, 150, 64, 0.1);
  min-width: 200px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 150, 64, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  padding: 10px 16px;
  background: transparent;
  color: #009640;
  border: 1px solid #009640;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: rgba(0, 150, 64, 0.1);
}

.btn-danger {
  padding: 10px 16px;
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* User management styles */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.user-card {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: white;
  gap: 15px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #009640;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.user-info {
  flex: 1;
}

.user-info h4 {
  margin: 0 0 5px 0;
  color: #111827;
}

.user-role {
  margin: 0 0 5px 0;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
}

.user-role.admin {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.user-role.shopkeeper {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.user-email {
  margin: 0 0 5px 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.user-last-login {
  margin: 0;
  color: #9ca3af;
  font-size: 0.8rem;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-users-message {
  text-align: center;
  color: #6b7280;
  padding: 30px;
  font-style: italic;
}

/* Modal styles */
.modal-overlay {
  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: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  margin: 0;
  color: #009640;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #009640;
}

.modal-body {
  padding: 20px 25px;
}

.modal-footer {
  padding: 15px 25px 25px 25px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.user-modal .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.user-modal .permissions-section h4 {
  margin: 20px 0 10px 0;
  color: #111827;
  font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .section-content {
    padding: 15px 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .settings-nav {
    gap: 8px;
  }
  
  .settings-nav-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .settings-header h1 {
    font-size: 1.3rem;
  }
  
  .section-header h3 {
    font-size: 1.1rem;
  }
  
  .btn-primary {
    min-width: auto;
    width: 100%;
  }
  
  .user-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .user-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }
  
  .modal-content {
    max-width: calc(100% - 40px);
  }
}

@media (max-width: 480px) {
  #settingsView .main-content {
    padding: 0 15px 15px 15px;
  }
  
  .settings-header h1 {
    font-size: 1.3rem;
  }
  
  .section-header {
    padding: 15px 20px 12px 20px;
  }
  
  .section-header h3 {
    font-size: 1.1rem;
  }
  
  .settings-nav-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .settings-nav {
    padding: 10px 0;
  }
  
  .settings-footer {
    padding: 15px 0;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px 20px;
  }
}