/**
 * Sales Monster Styles
 * Build 1.0.0 | 2026-02-10
 */

:root {
  --primary-color: #00C896; /* Mint green */
  --primary-hover: #00B586;
  --secondary-color: #6c757d;
  --danger-color: #dc3545;
  --text-color: #333;
  --border-color: #ddd;
  --bg-light: #f8f9fa;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  background: var(--bg-light);
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Login Screen */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 32px;
  margin-bottom: 5px;
}

.logo p {
  color: var(--secondary-color);
  font-size: 14px;
}

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

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

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

textarea {
  resize: vertical;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.checkbox-group label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

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

.btn-secondary:hover {
  background: #5a6268;
}

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

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

.btn-link {
  background: none;
  color: var(--primary-color);
  text-decoration: underline;
}

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 0;
  line-height: 1;
}

/* Header */
.app-header {
  background: white;
  padding: 20px 40px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  color: var(--primary-color);
  font-size: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Header layout */
.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0;
}

.tab-btn {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  color: var(--secondary-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.tab-btn:last-child {
  border-radius: 0 4px 4px 0;
  border-left: none;
}

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

.tab-btn:hover:not(.active) {
  background: #e9ecef;
}

.tab-panel {
  /* panels are shown/hidden via .hidden class */
}

/* Toolbar */
.toolbar {
  padding: 20px 40px;
  background: white;
  margin-top: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-container {
  flex: 1;
  max-width: 400px;
}

#search-input {
  width: 100%;
}

/* Filters */
.filters {
  padding: 15px 40px;
  background: white;
  margin-top: 1px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

/* Contact List */
.contact-list-container {
  padding: 20px 40px;
}

#contact-list {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.contact-row {
  display: grid;
  grid-template-columns: 2fr 2fr 3fr 1fr auto;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.contact-row:hover {
  background: var(--bg-light);
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-name {
  font-weight: 600;
}

.contact-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: uppercase;
}

.contact-actions {
  text-align: right;
}

/* Pagination */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button:hover {
  background: var(--bg-light);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  padding: 8px 12px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  margin: 0;
}

.modal form {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer .btn {
  flex: 1;
}

.modal-footer .btn-danger {
  flex: 0;
  margin-right: auto;
}

/* Messages */
.error-message {
  color: var(--danger-color);
  font-size: 14px;
  margin: 10px 0;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--secondary-color);
}

/* Build Info */
.build-info {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  color: var(--secondary-color);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--secondary-color);
}

.empty-state h3 {
  margin-bottom: 10px;
}

/* API Documentation */
.api-docs {
  padding: 20px 40px 60px;
}

.api-docs-content {
  background: white;
  border-radius: 8px;
  padding: 40px;
  max-width: 900px;
}

.api-docs-content h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 28px;
}

.api-docs-content h3 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 20px;
  color: var(--text-color);
}

.api-docs-content h4 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

.api-section {
  margin-bottom: 10px;
}

.api-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

.api-note {
  font-size: 14px;
  color: var(--secondary-color);
  margin-top: 10px;
  font-style: italic;
}

.api-list {
  padding-left: 20px;
  line-height: 1.8;
  font-size: 14px;
}

.api-list li {
  margin-bottom: 6px;
}

/* API code blocks */
.code-block {
  background: #1e1e2e;
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 15px;
}

.code-header {
  background: #313244;
  color: #a6adc8;
  padding: 6px 14px;
  font-size: 12px;
  font-family: monospace;
}

.code-block pre {
  padding: 14px;
  margin: 0;
  color: #cdd6f4;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-block code,
.api-docs-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

.api-docs-content p code,
.api-docs-content td code,
.api-docs-content li code {
  background: #f1f3f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #d63384;
}

/* API tables */
.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 15px;
  font-size: 14px;
}

.api-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-light);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
}

.api-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

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

/* Endpoint blocks */
.api-endpoint {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  border-left: 4px solid var(--primary-color);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.endpoint-header code {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.method {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  text-transform: uppercase;
}

.method.post {
  background: #198754;
  color: white;
}

.method.get {
  background: #0d6efd;
  color: white;
}
