/* CSS Styles for Auth Pages (login, register, admin) */
*, *:before, *:after {
  box-sizing: border-box;
}

:root {
  --auth-bg: #070913;
  --auth-card-bg: rgba(13, 17, 33, 0.7);
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-text-primary: #ffffff;
  --auth-text-secondary: rgba(255, 255, 255, 0.6);
  --auth-glow: 0 0 20px rgba(54, 124, 216, 0.3);
  --auth-accent: #367cd8;
  --auth-accent-hover: #4e92eb;
  --auth-danger: #ea4335;
  --auth-danger-hover: #ff5c4d;
  --auth-success: #34a853;

  /* Custom components */
  --auth-input-bg: rgba(255, 255, 255, 0.05);
  --auth-input-focus-bg: rgba(255, 255, 255, 0.08);
  --auth-section-bg: rgba(255, 255, 255, 0.02);
  --auth-dropdown-bg: #0d1121;
  --auth-table-border: rgba(255, 255, 255, 0.05);
  --auth-detail-bg: rgba(255, 255, 255, 0.02);
  --auth-detail-border: rgba(255, 255, 255, 0.1);
  --auth-modal-bg: #0d1121;
  --auth-btn-secondary-bg: rgba(255, 255, 255, 0.08);
  --auth-btn-secondary-hover-bg: rgba(255, 255, 255, 0.15);
  --auth-dropdown-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --auth-bg: #f1f5f9;
    --auth-card-bg: rgba(255, 255, 255, 0.85);
    --auth-border: rgba(0, 0, 0, 0.08);
    --auth-text-primary: #0f172a;
    --auth-text-secondary: rgba(15, 23, 42, 0.6);
    --auth-glow: 0 4px 20px rgba(54, 124, 216, 0.1);
    --auth-accent: #367cd8;
    --auth-accent-hover: #215db0;

    /* Custom components */
    --auth-input-bg: rgba(0, 0, 0, 0.04);
    --auth-input-focus-bg: rgba(0, 0, 0, 0.07);
    --auth-section-bg: rgba(0, 0, 0, 0.02);
    --auth-dropdown-bg: #ffffff;
    --auth-table-border: rgba(0, 0, 0, 0.08);
    --auth-detail-bg: rgba(0, 0, 0, 0.02);
    --auth-detail-border: rgba(0, 0, 0, 0.15);
    --auth-modal-bg: #ffffff;
    --auth-btn-secondary-bg: rgba(0, 0, 0, 0.06);
    --auth-btn-secondary-hover-bg: rgba(0, 0, 0, 0.12);
    --auth-dropdown-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  /* Admin search input inline styles override for light mode */
  #adminSearchOrderId, #adminSearchUsername {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
  }
}

body.auth-page {
  background: var(--auth-bg) url('/bg/Backgroud.png') no-repeat top center;
  background-size: 100% auto;
  color: var(--auth-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-sizing: border-box;
}

.auth-card {
  background: var(--auth-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--auth-glow);
  text-align: center;
  box-sizing: border-box;
}

.auth-card .logo img {
  height: 60px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-card h2 {
  font-size: 24px;
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auth-card p {
  color: var(--auth-text-secondary);
  font-size: 14px;
  margin: 0 0 30px 0;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--auth-text-secondary);
  font-weight: 600;
}

.form-control-auth {
  width: 100%;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--auth-text-primary);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.form-control-auth:focus {
  outline: none;
  background: var(--auth-input-focus-bg);
  border-color: var(--auth-accent);
  box-shadow: 0 0 10px rgba(54, 124, 216, 0.2);
}

.btn-auth {
  display: block;
  width: 100%;
  background: var(--auth-accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(54, 124, 216, 0.4);
}

.btn-auth:hover {
  background: var(--auth-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(54, 124, 216, 0.6);
}

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

.auth-footer {
  margin-top: 25px;
  font-size: 14px;
  color: var(--auth-text-secondary);
}

.auth-footer a {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Alert Notification styling */
.alert-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.alert-popup.show {
  transform: translateY(0);
  opacity: 1;
}

.alert-popup.success {
  background: var(--auth-success);
}

.alert-popup.error {
  background: var(--auth-danger);
}

/* Admin Dashboard layout */
body.admin-page {
  background: var(--auth-bg) url('/bg/Backgroud.png') no-repeat top center;
  background-size: 100% auto;
  color: var(--auth-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.admin-container {
  max-width: 1000px;
  margin: 40px auto;
  background: var(--auth-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--auth-border);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--auth-border);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.admin-header h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
}

.admin-header .nav-btns {
  display: flex;
  gap: 15px;
}

.btn-secondary-auth {
  background: var(--auth-btn-secondary-bg);
  color: var(--auth-text-primary);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-secondary-auth:hover {
  background: var(--auth-btn-secondary-hover-bg);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .admin-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.admin-section {
  background: var(--auth-section-bg);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  padding: 25px;
}

.admin-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
  border-bottom: 1px solid var(--auth-table-border);
  padding-bottom: 10px;
}

/* User table */
.user-table-wrapper {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.user-table th, .user-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--auth-table-border);
}

.user-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--auth-text-secondary);
  font-weight: 600;
}

.user-table td {
  font-size: 14px;
}

.btn-delete-user {
  background: transparent;
  color: var(--auth-danger);
  border: 1px solid rgba(234, 67, 85, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-delete-user:hover {
  background: var(--auth-danger);
  color: white;
  border-color: var(--auth-danger);
}

/* Header auth elements styles */
.header-auth-btn,
.container__header__desktop .wrapper .header__links .list__item a.header-auth-btn,
.container__header__mobile .wrapper a.header-auth-btn {
  background: var(--auth-accent);
  color: #ffffff !important;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-auth-btn:hover,
.container__header__desktop .wrapper .header__links .list__item a.header-auth-btn:hover,
.container__header__mobile .wrapper a.header-auth-btn:hover {
  background: var(--auth-accent-hover);
  color: #ffffff !important;
}

.header-auth-link {
  color: var(--auth-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.header-auth-link:hover {
  color: var(--auth-accent);
}

.header-user-dropdown {
  position: relative;
  display: inline-block;
}

.header-user-trigger {
  background: transparent;
  color: var(--auth-text-primary);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-user-trigger:hover {
  color: var(--auth-accent);
}

.header-user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--auth-dropdown-bg) !important;
  border: 1px solid var(--auth-border) !important;
  border-radius: 12px !important;
  min-width: 160px !important;
  box-shadow: var(--auth-dropdown-shadow) !important;
  z-index: 1000 !important;
  padding: 8px 0 !important;
  margin-top: 5px !important;
}

.header-user-menu.show {
  display: block !important;
}

.header-user-menu a, .header-user-menu button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  color: var(--auth-text-primary) !important;
  text-decoration: none !important;
  text-align: left !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.header-user-menu a:hover, .header-user-menu button:hover {
  background: var(--auth-input-bg) !important;
  color: var(--auth-accent) !important;
}

/* Order and Checkout System Styles */
.badge-status {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-pending {
  background: rgba(251, 188, 5, 0.15);
  color: #fbbc05;
  border: 1px solid rgba(251, 188, 5, 0.2);
}

.badge-pending-payment {
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

.badge-completed {
  background: rgba(52, 168, 83, 0.15);
  color: var(--auth-success);
  border: 1px solid rgba(52, 168, 83, 0.2);
}

.badge-cancelled {
  background: rgba(234, 67, 85, 0.15);
  color: var(--auth-danger);
  border: 1px solid rgba(234, 67, 85, 0.2);
}

/* Modal Overlay & Modal Window */
.order-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 9, 19, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 15px;
}

.order-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.order-modal-card {
  background: var(--auth-modal-bg);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), var(--auth-glow);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.order-modal-overlay.show .order-modal-card {
  transform: translateY(0);
}

.order-modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--auth-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.order-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--auth-text-primary);
}

.order-modal-close {
  background: transparent;
  border: none;
  color: var(--auth-text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.order-modal-close:hover {
  color: var(--auth-danger);
}

.order-modal-card-history {
  max-width: 700px;
}

.order-modal-search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 15px;
}

.order-modal-search-input {
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--auth-text-primary);
  font-size: 13px;
  outline: none;
  width: 160px;
  transition: border-color 0.2s;
}

.order-modal-search-input:focus {
  border-color: var(--auth-accent);
}

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

.order-payment-qr {
  text-align: center;
  margin-bottom: 25px;
  background: var(--auth-detail-bg);
  border: 1px dashed var(--auth-border);
  border-radius: 16px;
  padding: 15px;
}

.order-payment-qr img {
  width: 180px;
  border-radius: 12px;
  margin-top: 10px;
}

/* History Modal Custom styling */
.order-history-wrapper {
  max-height: 350px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  -webkit-overflow-scrolling: touch;
}

.order-history-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.order-history-table th, .order-history-table td {
  padding: 12px 15px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--auth-table-border);
}

.order-history-table th {
  background: var(--auth-section-bg);
  color: var(--auth-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
}

.order-history-table tbody tr:last-child td {
  border-bottom: none;
}

.order-form-details-row {
  display: none;
}

.order-form-details-row.show {
  display: table-row;
}

.order-form-details-box {
  padding: 15px;
  background: var(--auth-detail-bg);
  border: 1px dashed var(--auth-detail-border);
  border-radius: 10px;
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Responsive design for Admin Dashboard */
@media (max-width: 767.98px) {
  body.admin-page {
    padding: 10px;
    overflow-x: hidden;
  }
  .admin-container {
    margin: 10px auto;
    padding: 15px;
    border-radius: 16px;
    width: auto;
    overflow-x: hidden;
  }
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }
  .admin-header h1 {
    font-size: 22px;
    text-align: center;
  }
  .admin-header .nav-btns {
    flex-direction: column;
    gap: 10px;
  }
  .btn-secondary-auth {
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
  }
  .admin-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .admin-section {
    padding: 15px;
    border-radius: 14px;
    min-width: 0;
    width: 100%;
  }
  .admin-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
  }
  .user-table th, .user-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  .admin-orders-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border: none;
  }
  .admin-orders-table thead {
    display: none;
  }
  .admin-orders-table tbody {
    display: block;
    width: 100%;
  }
  .admin-orders-table tr {
    display: block;
    width: 100%;
    background: var(--auth-section-bg);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
  }
  .admin-orders-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--auth-table-border);
    font-size: 12px;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
  }
  .admin-orders-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .admin-orders-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--auth-text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    text-align: left;
    margin-right: 15px;
  }
  .admin-users-table {
    min-width: 600px;
  }
  /* Prevent inputs and buttons from overflowing */
  .admin-section form, .admin-section .form-group {
    width: 100%;
    min-width: 0;
  }
  .admin-section input, .admin-section textarea, .admin-section select, .admin-section button {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .order-modal-overlay {
    padding: 10px;
  }
  .order-modal-card {
    border-radius: 16px;
    max-height: 95vh;
  }
  .order-modal-body {
    padding: 15px;
  }
  .order-modal-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
    padding-right: 45px;
  }
  .order-modal-header h3 {
    font-size: 18px;
    text-align: left;
  }
  .order-modal-search-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
  }
  .order-modal-search-input {
    width: 100% !important;
  }
  .order-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 600px) {
  .order-history-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border: none;
  }
  .order-history-table thead {
    display: none;
  }
  .order-history-table tbody {
    display: block;
    width: 100%;
  }
  .order-history-table tr {
    display: block;
    width: 100%;
    background: var(--auth-section-bg);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
  }
  .order-history-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--auth-table-border);
    font-size: 13px;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
  }
  .order-history-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .order-history-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--auth-text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    text-align: left;
    margin-right: 15px;
  }
  .order-history-table tr.order-form-details-row {
    display: none;
  }
  .order-history-table tr.order-form-details-row.show {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    margin-top: -10px;
    margin-bottom: 15px;
  }
  .order-form-details-row td {
    display: block;
    padding: 0;
    border: none;
    text-align: left;
  }
  .order-form-details-row td::before {
    display: none;
  }
  .order-form-details-box {
    margin-top: 0;
  }
  .order-history-wrapper {
    border: none;
    padding: 0;
    max-height: 450px;
  }
}


