@import url("reset.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #f8fafc;
  --accent-color: #10b981;
  --accent-hover: #059669;
  --error-color: #dc2626;
  --error-hover: #b91c1c;
  --warning-color: #d97706;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --background: #ffffff;
  --surface: #f8fafc;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nav {
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  min-height: 70px;
}

.nav-container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 0;
  position: relative;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  margin: 0 auto;
}

.nav-links li {
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-links li a:hover {
  color: var(--text-primary);
  background-color: var(--surface);
}

.nav-links li a.active {
  color: var(--primary-color);
  background-color: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

.nav-actions {
  position: absolute;
  right: 0;
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.hamburger-btn:hover {
  background-color: var(--surface);
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  align-items: center;
  width: 100%;
}

.nav-overlay {
  display: none;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 80px);
}

.container {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

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

.btn-success:hover {
  background: var(--accent-hover);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--background);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border-light);
  cursor: not-allowed;
  opacity: 0.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  padding-right: 2.5rem;
  appearance: none;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--background);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

@media (max-width: 480px) {
  table {
    min-width: 500px;
  }
  
  thead th,
  tbody td {
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
  }
  
  .table-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    width: 100%;
  }
  
  code {
    font-size: 0.65rem;
    display: block;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

thead {
  background: var(--surface);
}

thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--surface);
}

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

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-actions .btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-edit {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.btn-edit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-delete {
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: var(--error-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.table-actions form {
  display: inline-block;
  margin: 0;
}

.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  width: 100%;
}

.header-actions h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
}

.card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

.card-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-color);
}

.status-warning {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

code {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .content {
    padding: 1rem;
  }

  .container {
    padding: 1rem;
  }

  .nav {
    padding: 0 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.75rem;
  }

  thead th,
  tbody td {
    padding: 0.75rem 0.5rem;
  }

  .header-actions {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .nav-container {
    position: relative;
    padding: 1.25rem 0;
    justify-content: flex-start;
  }

  .hamburger-btn {
    display: flex;
    position: relative;
    margin-left: 1rem;
    z-index: 100;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--background);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 5rem 0 2rem 0;
    transition: left 0.3s ease;
    z-index: 50;
    overflow-y: auto;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
    margin: 0;
    width: 100%;
  }

  .nav-links li a {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }

  .nav-links li a:hover {
    background-color: var(--surface);
    padding-left: 2.5rem;
  }

  .nav-links li a.active {
    background-color: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--primary-color);
  }

  .nav-actions {
    position: static;
    margin: 1.5rem 2rem 0 2rem;
  }

  .logout-form {
    width: 100%;
  }

  .logout-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.875rem 1.5rem;
    margin: 0;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
  }

  .logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
  }

  .nav-overlay {
    display: block;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    display: table;
    min-width: 600px;
  }

  thead th {
    position: sticky;
    left: 0;
    z-index: 10;
    background: var(--surface);
  }

  tbody td:first-child {
    position: sticky;
    left: 0;
    background: var(--background);
    z-index: 5;
  }

  tbody tr:hover td:first-child {
    background: var(--surface);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.settings-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
  max-width: 800px;
}

.settings-card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0.5rem 0 0 0;
  line-height: 1.5;
}

.settings-form {
  margin-top: 1.5rem;
}

.label-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.form-help {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
  line-height: 1.4;
}

.form-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.form-actions .btn {
  min-width: 140px;
}

@media (max-width: 768px) {
  .settings-card {
    padding: 1.5rem;
  }
  
  .form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }
}

.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--border-light) 100%);
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin-bottom: 1.5rem;
  color: #dc2626;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-icon {
  font-size: 1rem;
}

.error-icon i[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.5;
}

.login-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.login-header h1 i[data-lucide] {
  width: 1.2em;
  height: 1.2em;
  stroke-width: 1.5;
}

.login-form label {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.login-form .label-icon {
  display: flex;
  align-items: center;
}

.login-form .label-icon i[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.login-footer small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

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

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

@media (max-width: 480px) {
  .login-main {
    padding: 1rem;
  }
  
  .login-card {
    padding: 2rem 1.5rem;
  }
  
  .login-header h1 {
    font-size: 1.5rem;
  }
}

*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

/* Lucide icon styling */
i[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.5;
}

.nav-links i[data-lucide] {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.btn i[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.label-icon {
  display: flex;
  align-items: center;
}

.label-icon i[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.5;
  flex-shrink: 0;
}

h1, h2, h3 {
  display: flex;
  align-items: center;
}

h1 i[data-lucide], h2 i[data-lucide], h3 i[data-lucide] {
  margin-right: 0.5rem;
  stroke-width: 1.5;
}

/* File upload styling */
.file-upload-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-upload-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 60px;
  text-align: center;
}

.file-upload-button:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
}

.file-upload-button.has-file {
  border-color: var(--accent-color);
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-color);
  border-style: solid;
}

.file-upload-icon {
  font-size: 1.2rem;
}

.file-upload-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-upload-primary {
  font-weight: 600;
}

.file-upload-secondary {
  font-size: 0.75rem;
  opacity: 0.8;
}

.file-upload-info {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
