/* GoCierge Branding Colors */
:root {
  --primary-color: #1a1a1a;
  --secondary-color: #f5f5f5;
  --accent-color: #9c7243;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --success-color: #28a745;
  --error-color: #dc3545;
  --white: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background: var(--secondary-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2a2a2a 100%);
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-image {
  height: 40px;
  width: auto;
  margin-bottom: 5px;
}

.tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 15px;
}

.header h2 {
  color: var(--white);
  font-size: 1.5em;
  font-weight: 400;
  margin-top: 15px;
}

.header h2 {
  color: var(--text-color);
  font-size: 1.5em;
  font-weight: 400;
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
}

.sidebar {
  background: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  height: fit-content;
}

.agent-selector {
  margin-bottom: 20px;
}

.agent-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.agent-selector input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  margin-bottom: 10px;
  font-size: 14px;
}

.agent-selector button {
  width: 100%;
  padding: 10px;
  background: var(--accent-color);
  color: var(--white);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.agent-selector button:hover {
  background: #0056b3;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: var(--text-light);
  color: var(--white);
}

.btn-secondary:hover {
  background: #555;
}

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

.btn-danger:hover {
  background: #c82333;
}

.btn-nfc {
  background: linear-gradient(135deg, #9c7243 0%, #7a5a35 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-nfc:hover {
  background: linear-gradient(135deg, #7a5a35 0%, #5d4428 100%);
}

.btn-nfc:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.nfc-icon {
  font-size: 1.2em;
}

/* All agents table (dashboard directory) */
.agents-directory {
  background: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.agents-directory-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.agents-directory-header h3 {
  font-size: 1.15em;
  font-weight: 600;
}

.agents-directory-hint {
  color: var(--text-light);
  font-size: 0.9em;
  margin-bottom: 14px;
}

.btn-inline {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
}

.agents-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.agents-loading {
  padding: 20px;
  color: var(--text-light);
}

.agents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.agents-table th,
.agents-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.agents-table th {
  background: var(--secondary-color);
  font-weight: 600;
  white-space: nowrap;
}

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

.agents-table tbody tr:hover {
  background: rgba(156, 114, 67, 0.06);
}

.agents-table .slug-cell {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.agents-table .url-cell a {
  word-break: break-all;
}

.agents-table .cell-actions {
  white-space: nowrap;
}

.agents-table .btn-table {
  padding: 6px 12px;
  font-size: 13px;
  width: auto;
  margin-right: 6px;
}

.agents-table .btn-table:last-child {
  margin-right: 0;
}

.agents-table-error {
  padding: 16px;
  color: var(--error-color);
}

/* VCard List */
.vcard-list {
  background: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-height: 400px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.vcard-item {
  background: var(--secondary-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.vcard-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.vcard-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.vcard-item-info h3 {
  color: var(--primary-color);
  margin-bottom: 5px;
}

.vcard-item-info p {
  color: var(--text-light);
  font-size: 0.9em;
}

.vcard-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.vcard-item-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
  width: auto;
}

.qr-preview {
  width: 100px;
  height: 100px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  margin-top: 10px;
}

/* Form */
.form-container {
  background: var(--white);
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.form-container h3 {
  margin-bottom: 25px;
  color: var(--primary-color);
  font-size: 1.8em;
}

.form-container h4 {
  margin: 25px 0 15px 0;
  color: var(--text-color);
  font-size: 1.2em;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.form-actions .btn {
  flex: 1;
}

/* Card View Page */
.card-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2a2a2a 100%);
  padding: 30px;
  border-radius: 10px 10px 0 0;
  box-shadow: var(--shadow);
  text-align: center;
}

.card-header .logo-image {
  height: 40px;
  width: auto;
  margin-bottom: 5px;
}

.card-header .tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 0;
}

.card-content {
  background: var(--white);
  padding: 40px;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
}

.business-card {
  text-align: center;
}

.card-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 30px;
  border: 4px solid var(--accent-color);
}

.card-info h2 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.card-info .title {
  font-size: 1.3em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.card-info .company {
  font-size: 1.1em;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 30px;
}

.contact-info {
  text-align: left;
  max-width: 500px;
  margin: 0 auto 30px;
  background: var(--secondary-color);
  padding: 25px;
  border-radius: 8px;
}

.contact-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.contact-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-color);
}

.contact-item a {
  color: var(--accent-color);
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

.bio {
  text-align: left;
  max-width: 600px;
  margin: 30px auto;
  padding: 20px;
  background: var(--secondary-color);
  border-radius: 8px;
  font-style: italic;
  color: var(--text-light);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.social-link {
  padding: 10px 20px;
  background: var(--accent-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
}

.social-link:hover {
  background: #0056b3;
}

.card-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.nfc-hint {
  font-size: 0.88em;
  color: var(--text-light);
  line-height: 1.45;
  max-width: 520px;
  margin: -12px auto 24px;
  text-align: center;
}

.share-strip {
  margin: 24px 0 8px;
  padding: 16px;
  background: var(--secondary-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.share-strip-label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.share-strip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88em;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}

.share-chip:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.share-chip-whatsapp {
  background: #25d366;
}

.share-chip-viber {
  background: #7360f2;
}

.share-chip-telegram {
  background: #0088cc;
}

.share-chip-email {
  background: var(--text-light);
}

.share-chip-facebook {
  background: #1877f2;
}

.share-chip-linkedin {
  background: #0a66c2;
}

.share-chip-x {
  background: #000;
}

.share-chip-copy {
  background: var(--accent-color);
}

.qr-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color);
}

.qr-section h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.qr-code {
  max-width: 300px;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
  margin: 20px auto;
  display: block;
}

.qr-link {
  margin-top: 15px;
  color: var(--text-light);
  font-size: 0.9em;
}

.qr-link a {
  color: var(--accent-color);
  text-decoration: none;
}

.loading,
.error {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.error h2 {
  color: var(--error-color);
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

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

  .vcard-item-header {
    flex-direction: column;
    gap: 15px;
  }

  .vcard-item-actions {
    flex-direction: column;
  }

  .card-info h2 {
    font-size: 2em;
  }

  .card-photo {
    width: 150px;
    height: 150px;
  }

  .social-links,
  .card-actions,
  .share-strip-links {
    flex-direction: column;
  }

  .social-links .social-link,
  .card-actions .btn,
  .share-chip {
    width: 100%;
    justify-content: center;
  }
}
