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

:root {
  --color-navy: #1B2A4A;
  --color-teal: #00B5AD;
  --color-white: #FFFFFF;
  --color-light-gray: #F4F6F9;
  --color-text: #2C3E50;
  --color-border: #E8EDF2;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--color-light-gray);
  color: var(--color-text);
}

body {
  line-height: 1.6;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--color-navy) 0%, #0F1F35 100%);
  color: var(--color-white);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
}

.header-logo {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-logo-img {
  height: 24px;
  display: block;
}

.header-title {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  padding-left: 1.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(27, 42, 74, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.auth-modal h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--color-navy);
}

.auth-modal p {
  font-size: 0.875rem;
  color: var(--color-text);
  opacity: 0.7;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 181, 173, 0.1);
}

.auth-error {
  color: #D84040;
  font-size: 0.75rem;
  text-align: left;
  margin-top: -0.5rem;
}

.auth-overlay.hidden {
  display: none;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

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

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

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

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

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

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Cards */
.card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.card:hover {
  border-left-color: var(--color-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-navy);
}

.card-description {
  font-size: 0.875rem;
  color: var(--color-text);
  opacity: 0.75;
  margin-bottom: 1rem;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text);
  opacity: 0.6;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.card-badge {
  display: inline-block;
  background: rgba(0, 181, 173, 0.15);
  color: var(--color-teal);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.card-date {
  color: var(--color-teal);
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
}

.card-actions .btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.75rem;
  font-size: 0.8125rem;
}

/* Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Container */
.container {
  width: 100%;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-navy);
}

.empty-state p {
  opacity: 0.7;
  font-size: 0.875rem;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: rgba(0, 181, 173, 0.02);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--color-teal);
  background: rgba(0, 181, 173, 0.05);
}

.upload-area-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.upload-area-text {
  font-size: 0.875rem;
  color: var(--color-text);
}

.upload-area-text strong {
  color: var(--color-teal);
}

.upload-input {
  display: none;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.form-input,
.form-textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 181, 173, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-text);
  opacity: 0.6;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
}

.table thead {
  background: var(--color-light-gray);
  border-bottom: 1px solid var(--color-border);
}

.table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background: rgba(0, 181, 173, 0.02);
}

/* Utility */
.hidden {
  display: none !important;
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 181, 173, 0.3);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-navy);
  color: var(--color-white);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  max-width: 300px;
  animation: slideIn 0.3s ease-out;
  z-index: 999;
}

.toast.success {
  background: #10A566;
}

.toast.error {
  background: #D84040;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }

  .header-logo {
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .auth-modal {
    padding: 2rem 1.5rem;
  }

  .auth-modal h2 {
    font-size: 1.5rem;
  }

  .container {
    padding: 1rem;
  }
}
