@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-gradient-1: #f3f4f6;
  --bg-gradient-2: #e5e7eb;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
  --danger: #ef4444;
  --success: #10b981;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  background: var(--bg-gradient-1);
}

.bg-gray {
  background: #f8fafc;
}

/* Utils */
.mb-4 {
  margin-bottom: 1.5rem;
}

.text-right {
  text-align: right;
}

.text-success {
  color: var(--success);
}

.icon-sm {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.icon-brand {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.icon-xl {
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Animations */
.animated {
  animation-duration: 0.6s;
  animation-fill-mode: both;
}

.fadeIn {
  animation-name: fadeIn;
}

.delay-1 {
  animation-delay: 0.1s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= LOGIN ================= */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.icon-header {
  width: 60px;
  height: 60px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.icon-header i {
  width: 28px;
  height: 28px;
}

.login-card h2 {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.input-group {
  text-align: left;
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.input-group input[type="text"],
.input-group input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: #fff;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ================= ALERTS ================= */
.alert {
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ================= NAVBAR ================= */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  padding: 15px 40px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.badge {
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  background: #f9fafb;
  border: 1px solid var(--border-light);
}

.btn-logout:hover {
  color: var(--danger);
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ================= CONTAINER & CARDS ================= */
.container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card-header {
  padding: 24px 30px;
}

.border-bottom {
  border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-body {
  padding: 24px 30px;
  background: #fafafa;
  border-top: 1px solid var(--border-light);
}

/* Upload Form */
.upload-flex {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.flex-grow {
  flex: 1;
  min-width: 250px;
}

.align-bottom {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.file-input {
  width: 100%;
  padding: 9px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
}

.file-input:focus {
  border-color: var(--primary);
  border-style: solid;
  outline: none;
}

/* ================= TABLE & FILTERS ================= */
.table-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 350px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border: 1px solid var(--border-light);
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
}

.table-responsive {
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.modern-table th {
  background: #f8fafc;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.modern-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.modern-table tr:last-child td {
  border-bottom: none;
}

.modern-table tbody tr:hover {
  background: #fafafa;
}

.empty-state {
  text-align: center;
  padding: 60px 20px !important;
  color: var(--text-muted);
}

.img-preview-box {
  width: 140px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  padding: 4px;
  position: relative;
}

.img-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.copy-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-wrapper {
  display: flex;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.link-readonly {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  outline: none;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #fff;
  border: none;
  border-left: 1px solid var(--border-light);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.btn-copy i {
  width: 14px;
  height: 14px;
}

.action-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  transition: all 0.2s;
  cursor: pointer;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
}

.btn-danger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  transition: all 0.2s;
  text-decoration: none;
}

.btn-danger-icon:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger-icon i {
  width: 16px;
  height: 16px;
}

/* ================= MODAL ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-primary.sm {
  padding: 10px 16px;
  width: auto;
  margin: 0;
}

/* ================= TOASTS ================= */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px 20px;
  }

  .upload-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .align-bottom {
    justify-content: flex-end;
  }

  .card-header,
  .card-body {
    padding: 20px;
  }

  .modern-table th,
  .modern-table td {
    padding: 16px 20px;
  }
}