/* ==========================================================================
   Dev Marlon - Comissões & Portfólio
   Estilo Minimalista, Dark Matte & Clean (Sem excesso de brilhos/UIStroke)
   ========================================================================== */

:root {
  --bg-main: #0c0d0f;
  --bg-card: #141619;
  --bg-card-hover: #181b20;
  --bg-modal: #141619;
  --bg-input: #0f1012;
  --bg-tag: #1c1f24;

  --border-color: #23272e;
  --border-hover: #343a45;
  --border-focus: #525a66;

  --accent-btn: #ffffff;
  --accent-btn-text: #090a0c;
  --accent-btn-hover: #e2e4e8;

  --text-main: #f1f3f5;
  --text-muted: #9ba3af;
  --text-dim: #636b78;

  --danger-bg: #2d1517;
  --danger-border: #4d2024;
  --danger-text: #f87171;

  --success-bg: #12281e;
  --success-border: #1d4d38;
  --success-text: #4ade80;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --transition: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #23272e;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #343a45;
}

/* Container */
.container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Admin Top Bar */
.admin-bar {
  background: #111317;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-badge .dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header */
.header {
  padding: 55px 0 35px 0;
  text-align: center;
}

.header-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.main-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  display: inline-block;
}

.main-title:hover {
  opacity: 0.9;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 580px;
  margin: 10px auto 0 auto;
  font-weight: 400;
}

/* Search and Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 30px 0 24px 0;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--border-focus);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* Systems List */
.systems-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 60px;
}

/* System Card */
.system-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: stretch;
  transition: var(--transition);
}

.system-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* Card Image Left */
.card-media {
  width: 220px;
  min-width: 220px;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: #0a0a0c;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.card-media:hover img {
  opacity: 0.92;
}

.card-media .category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(12, 13, 15, 0.88);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Content Right */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.system-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-tag);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: nowrap;
}

.system-description {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.card-actions-public {
  display: flex;
  gap: 8px;
}

.card-actions-admin {
  display: flex;
  gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: var(--bg-tag);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-admin-add {
  background: #1b281f;
  border: 1px solid #285432;
  color: #4ade80;
}
.btn-admin-add:hover {
  background: #233829;
}

.btn-admin-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-admin-logout:hover {
  background: #201314;
  color: #f87171;
  border-color: #482023;
}

.btn-edit {
  padding: 6px 10px;
  font-size: 0.78rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-edit:hover {
  background: var(--bg-tag);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-delete {
  padding: 6px 10px;
  font-size: 0.78rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}
.btn-delete:hover {
  background: #3d1c1f;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.empty-state svg {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Secret trigger icon in footer */
.secret-trigger {
  width: 14px;
  height: 14px;
  opacity: 0.15;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.secret-trigger:hover {
  opacity: 0.7;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
}

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

/* Image Upload Dropzone */
.image-upload-wrapper {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: var(--transition);
}

.image-upload-wrapper:hover {
  border-color: var(--border-hover);
}

.upload-preview {
  max-height: 120px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  display: none;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
}

.toast.success {
  border-left: 3px solid #22c55e;
}

.toast.error {
  border-left: 3px solid #ef4444;
}

.toast.info {
  border-left: 3px solid #71717a;
}

/* Responsividade */
@media (max-width: 768px) {
  .system-card {
    flex-direction: column;
    padding: 16px;
    gap: 14px;
  }

  .card-media {
    width: 100%;
    min-width: 100%;
    height: 180px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .card-actions-public, .card-actions-admin {
    width: 100%;
  }

  .card-actions-public .btn, .card-actions-admin .btn {
    flex: 1;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}
