/* Global Styles */
body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-text-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin-top: 0;
  color: var(--color-primary);
}

h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-2);
}

h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  opacity: 0.8;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-base), transform 150ms ease-out, box-shadow 150ms ease-out;
  border: 1px solid transparent;
  gap: var(--space-2);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #2a2624;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-background);
  border-color: var(--color-secondary);
}

.btn-danger {
  background-color: #fff1f1;
  color: var(--color-danger);
  border-color: #fecaca;
}

.btn-danger:hover {
  background-color: #fee2e2;
}

/* Global button hover animation (applies to all <button>) */
button {
  position: relative;
  overflow: hidden;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Shimmer highlight effect on button hover */
button::after {
  content: "";
  position: absolute;
  top: 0;
  right: -120%;
  height: 100%;
  width: 120%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  opacity: 0;
}

button:hover::after {
  animation: buttonShimmer 900ms ease-out forwards;
}

@keyframes buttonShimmer {
  0% { right: -120%; opacity: 0; }
  10% { opacity: 1; }
  60% { opacity: 1; }
  100% { right: 120%; opacity: 0; }
}

/* Anchor buttons get same hover + shimmer when using .btn-like */
a.btn-like {
  position: relative;
  overflow: hidden;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}

a.btn-like:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

a.btn-like::after {
  content: "";
  position: absolute;
  top: 0;
  right: -120%;
  height: 100%;
  width: 120%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  opacity: 0;
}

a.btn-like:hover::after {
  animation: buttonShimmer 900ms ease-out forwards;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.85rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  overflow-y: visible;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  background-color: var(--color-background);
  color: var(--color-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: none;
}

tr {
  position: relative;
}

tr:hover td {
  background-color: #faf9f8;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background-color: #ecfdf5;
  color: var(--color-success);
}

.status-inactive {
  background-color: #fef2f2;
  color: var(--color-danger);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(55, 50, 47, 0.4);
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--color-white);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-secondary);
  transition: color 0.2s;
}

.close:hover {
  color: var(--color-primary);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-main);
}

.focusable-input:focus {
  border-color: #303030 !important;
  box-shadow: 0 10px 12px -6px rgba(49, 46, 129, 0.35) !important;
  transform: translateY(-1px);
}

/* Utilities */
.text-muted { color: var(--color-secondary); }
.text-sm { font-size: 0.875rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }

/* Copy Link Style */
.copy-link {
  cursor: pointer;
  color: var(--color-primary);
  font-family: monospace;
  background: var(--color-background);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-link:hover {
  background: #e6e2df;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background-color: var(--color-white);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-main);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.nav-item svg {
  color: var(--color-secondary);
  transition: color 0.2s ease;
}

.nav-item:hover {
  background-color: var(--color-background);
  color: var(--color-primary);
}

.nav-item:hover svg {
  color: var(--color-primary);
}

.nav-item.active {
  background-color: #f0ebe8; /* Light warm gray matching the theme */
  color: var(--color-primary);
}

.nav-item.active svg {
  color: var(--color-primary);
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.nav-item.logout {
  color: var(--color-danger);
}

.nav-item.logout svg {
  color: var(--color-danger);
}

.nav-item.logout:hover {
  background-color: #fef2f2;
}

.main-content {
  flex: 1;
  margin-left: 240px; /* Width of sidebar */
  background-color: var(--color-background);
  min-height: 100vh;
}

/* Adjust container for main content */
/* Adjust container for main content */
.main-content .container {
  padding: var(--space-6);
  max-width: 100%;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  color: var(--color-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-toggle:hover {
  background-color: var(--color-background);
  color: var(--color-primary);
}

.dropdown-menu {
  display: none !important;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--color-white);
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  z-index: 1000;
  padding: var(--space-1);
  margin-top: var(--space-1);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-main);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: var(--color-background);
}

.dropdown-item.danger {
  color: var(--color-danger);
}

.dropdown-item.danger:hover {
  background-color: #fef2f2;
}
