/* Admin Panel - Matching Main Site Theme */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&family=JetBrains+Mono:wght@400&display=swap");

:root {
  --bg-canvas: #050505;
  --bg-dark: #0a0a0a;
  --text-ink: #ffffff;
  --text-muted: #888888;
  --accent-swiss: #ff3333;
  --accent-green: #00ff88;
  --grid-line: rgba(255, 255, 255, 0.05);
  --font-grotesk: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --card-bg: rgba(20, 20, 20, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-ink);
  font-family: var(--font-grotesk);
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 50px 50px;
  min-height: 100vh;
}

.admin-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid rgba(255, 51, 51, 0.3);
  position: relative;
}

.admin-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 200px;
  height: 2px;
  background: var(--accent-swiss);
}

.admin-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-ink);
  font-family: var(--font-grotesk);
  letter-spacing: -3px;
  text-transform: uppercase;
  position: relative;
  padding-left: 50px;
}

.admin-title::before {
  content: '//';
  position: absolute;
  left: 0;
  color: var(--accent-swiss);
  font-family: var(--font-mono);
}

.btn-add {
  padding: 1rem 2rem;
  background: var(--accent-swiss);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-grotesk);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
}

.btn-add::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-add:hover::before {
  left: 100%;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 51, 51, 0.5);
}

.btn-action {
  padding: 0.75rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.875rem;
  font-family: var(--font-grotesk);
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-swiss);
  color: var(--accent-swiss);
  transform: translateX(-3px);
}

.products-table {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-collapse: collapse;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.products-table th,
.products-table td {
  padding: 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.products-table th {
  background: rgba(255, 51, 51, 0.1);
  color: var(--accent-swiss);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
}

.products-table td {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.products-table tbody tr {
  transition: all 0.3s;
}

.products-table tbody tr:hover {
  background: rgba(255, 51, 51, 0.05);
  transform: translateX(5px);
}

.product-img-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.product-img-thumb:hover {
  transform: scale(1.5);
  border-color: var(--accent-swiss);
  z-index: 10;
  position: relative;
}

.badge-cell {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 51, 51, 0.2);
  color: var(--accent-swiss);
  font-size: 0.65rem;
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(255, 51, 51, 0.4);
}

.status-badge {
  padding: 0.4rem 1rem;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.status-published {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-draft {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-stock {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-out {
  background: rgba(255, 68, 68, 0.15);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.action-btns {
  display: flex;
  gap: 0.75rem;
}

.btn-action {
  padding: 0.6rem 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-swiss);
  color: var(--accent-swiss);
}

.btn-delete {
  border-color: rgba(255, 68, 68, 0.5);
  color: #ff4444;
}

.btn-delete:hover {
  background: rgba(255, 68, 68, 0.1);
  border-color: #ff4444;
  color: #ff4444;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  backdrop-filter: blur(10px);
  padding: 2rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
  padding: 3rem;
  max-width: 900px;
  width: 100%;
  border: 2px solid rgba(255, 51, 51, 0.3);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: modalSlideIn 0.3s ease-out;
  margin: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 51, 51, 0.2);
}

.modal-title {
  font-size: 2rem;
  color: var(--accent-swiss);
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.btn-close {
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid rgba(255, 51, 51, 0.3);
  color: var(--accent-swiss);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 45px;
  height: 45px;
  line-height: 1;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: rgba(255, 51, 51, 0.2);
  transform: rotate(90deg);
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-label .required {
  color: var(--accent-swiss);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-grotesk);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.form-select option {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-swiss);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-grotesk);
  line-height: 1.6;
}

.image-upload-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-grotesk);
  font-weight: 600;
}

.tab-btn.active {
  background: rgba(255, 51, 51, 0.1);
  border-color: var(--accent-swiss);
  color: var(--accent-swiss);
}

.tab-btn:hover {
  border-color: var(--accent-swiss);
  color: var(--accent-swiss);
}

.image-tab {
  display: none;
}

.image-tab.active {
  display: block;
}

.image-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  padding: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s;
  cursor: pointer;
  border-radius: 4px;
}

.image-upload-area:hover {
  border-color: var(--accent-swiss);
  background: rgba(255, 51, 51, 0.05);
}

.image-upload-area input[type="file"] {
  display: none;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.upload-hint {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.image-preview {
  margin-top: 1rem;
  text-align: center;
}

.image-preview img {
  max-width: 300px;
  max-height: 300px;
  border: 2px solid rgba(255, 51, 51, 0.3);
  border-radius: 4px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}

.form-checkbox:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 51, 51, 0.3);
}

.form-checkbox input {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--accent-swiss);
}

.form-checkbox span {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.btn-submit {
  width: 100%;
  padding: 1.25rem;
  background: var(--accent-swiss);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1rem;
  font-family: var(--font-grotesk);
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 51, 51, 0.5);
  background: #ff4444;
}

.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.loading::after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.error-message {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff4444;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
  font-size: 0.9rem;
}

.success-message {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--accent-green);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .products-table {
    font-size: 0.8rem;
  }
  
  .products-table th,
  .products-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .action-btns {
    flex-direction: column;
  }
}
