﻿/* ============================================================
   Seos Technology — Components CSS
   Buttons, Cards, Forms, Tables, Modal, Toast, Loader
   ============================================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(230, 57, 70, 0.4);
  outline-offset: 2px;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — red filled */
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
}

/* Outline — white bordered */
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  color: var(--white);
}

/* Outline dark — for light backgrounds */
.btn-outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-dark:hover {
  background: var(--navy);
  color: var(--white);
}

/* Secondary — gray */
.btn-secondary {
  background: var(--gray);
  color: var(--navy);
  border-color: var(--gray-200);
}
.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--navy);
}

/* Navy */
.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  color: var(--white);
}

/* Danger */
.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-danger:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}

/* Sizes */
.btn-sm { padding: 0.4375rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1.0625rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.125rem; }
.btn-block { width: 100%; }

/* Icon button */
.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--gray); color: var(--navy); }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--gray);
}

.card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0;
}

/* Product Card */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(27, 42, 74, 0.2);
}

.product-card-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img { transform: scale(1.04); }

.product-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(230, 57, 70, 0.9);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.product-card-body { padding: 1.25rem; flex: 1; }
.product-card-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.375rem; }
.product-card-desc { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.product-card-price span { font-size: 0.875rem; font-weight: 400; color: var(--muted); }

.product-card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Package Card */
.package-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.package-card.recommended {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.08);
}

.package-card-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
}

.package-name { font-size: 1.25rem; font-weight: 800; color: var(--navy); margin-bottom: 0.5rem; }
.package-desc { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; }
.package-price { font-size: 2.5rem; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 0.25rem; }
.package-price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.package-billing { font-size: 0.8125rem; color: var(--muted); margin-bottom: 1.5rem; }

.package-features { list-style: none; margin-bottom: 2rem; flex: 1; }
.package-feature {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--text);
  border-bottom: 1px solid var(--gray-200);
}
.package-feature:last-child { border-bottom: none; }
.package-feature .check { color: #198754; font-size: 1rem; flex-shrink: 0; }
.package-feature .cross { color: var(--muted); font-size: 1rem; flex-shrink: 0; }
.package-feature.excluded { color: var(--muted); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.375rem;
}

.form-label .required { color: var(--red); margin-left: 0.25rem; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.6875rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.1);
}

.form-control::placeholder { color: var(--muted); opacity: 0.7; }

.form-control.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236C757D' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-hint { font-size: 0.8125rem; color: var(--muted); margin-top: 0.375rem; }
.form-error { font-size: 0.8125rem; color: var(--red); margin-top: 0.375rem; display: flex; align-items: center; gap: 0.25rem; }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--navy);
}

.form-check-label { font-size: 0.9375rem; color: var(--text); cursor: pointer; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table thead tr {
  background: var(--navy);
  color: var(--white);
}

.table thead th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--gray); }

.table tbody td {
  padding: 0.875rem 1.25rem;
  color: var(--text);
  vertical-align: middle;
}

.table-striped tbody tr:nth-child(even) { background: rgba(248, 249, 250, 0.6); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 74, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--navy); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gray);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--navy); }

.modal-body { padding: 1.5rem 1.75rem; }
.modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--navy);
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
}

.toast.hiding { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.toast-success { border-left-color: #198754; }
.toast-error   { border-left-color: var(--red); }
.toast-warning { border-left-color: #ffc107; }
.toast-info    { border-left-color: #0dcaf0; }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; }
.toast-success .toast-icon { color: #198754; }
.toast-error   .toast-icon { color: var(--red); }
.toast-warning .toast-icon { color: #856404; }

.toast-content { flex: 1; }
.toast-title { font-size: 0.9375rem; font-weight: 700; color: var(--navy); margin-bottom: 0.125rem; }
.toast-message { font-size: 0.875rem; color: var(--muted); }

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--navy); }

/* ---- Loader / Spinner ---- */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(27, 42, 74, 0.15);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.spinner-white { border-color: rgba(255,255,255,0.3); border-top-color: var(--white); }
.spinner-red { border-color: rgba(230,57,70,0.2); border-top-color: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loading-overlay .spinner { width: 48px; height: 48px; border-width: 4px; }
.loading-overlay p { font-size: 0.9375rem; color: var(--muted); }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2rem;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state-title { font-size: 1.125rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.empty-state-desc { font-size: 0.9375rem; color: var(--muted); margin-bottom: 1.5rem; }

/* ---- Alert ---- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.alert-success { background: rgba(25, 135, 84, 0.08); border-color: #198754; color: #0a3622; }
.alert-error   { background: rgba(230, 57, 70, 0.08); border-color: var(--red); color: #58151c; }
.alert-warning { background: rgba(255, 193, 7, 0.1); border-color: #ffc107; color: #664d03; }
.alert-info    { background: rgba(13, 202, 240, 0.08); border-color: #0dcaf0; color: #055160; }

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.4375rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---- Search Input ---- */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--muted);
  pointer-events: none;
  font-size: 1rem;
}

.search-input {
  padding-left: 2.5rem;
  border-radius: 20px;
}

/* ---- Stat Card ---- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 0.25rem; }
.stat-change { font-size: 0.8125rem; color: var(--muted); }
.stat-change.positive { color: #198754; }
.stat-change.negative { color: var(--red); }

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: var(--gray); color: var(--navy); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(230, 57, 70, 0.06); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }

/* ---- Toggle Switch ---- */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  transition: background var(--transition);
  position: relative;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}

.toggle-input:checked + .toggle-track { background: var(--navy); }
.toggle-input:checked + .toggle-track::after { transform: translateX(20px); }

.toggle-label { font-size: 0.9375rem; color: var(--text); }
