/* Twilio SMS Configuration Page Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 700px;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.card-header {
  padding: 30px 30px 20px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.logo {
  display: inline-block;
  margin-bottom: 16px;
}

.card-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2d3d;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #666;
}

.card-body {
  padding: 30px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2d3d;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

.input-with-toggle {
  position: relative;
}

.input-with-toggle input {
  padding-right: 45px;
}

.btn-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: #666;
}

.btn-toggle:hover {
  color: #1f2d3d;
}

.hint {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: #0066cc;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  color: #666;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #e5e7eb;
  color: #1f2d3d;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  color: #1f2d3d;
}

.tab.active {
  background: white;
  color: #1f2d3d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.error {
  padding: 12px 14px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 16px;
}

.success {
  padding: 12px 14px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #16a34a;
  font-size: 14px;
  margin-bottom: 16px;
}

.help-section {
  margin-bottom: 24px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2d3d;
  margin-bottom: 12px;
}

.help-section p {
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
  line-height: 1.6;
}

.help-section ol,
.help-section ul {
  padding-left: 20px;
  color: #444;
}

.help-section li {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.help-section a {
  color: #0066cc;
  text-decoration: none;
}

.help-section a:hover {
  text-decoration: underline;
}

.help-section code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* History Tab Styles */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2d3d;
  margin: 0;
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #1f2d3d;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: #f3f4f6;
}

.btn-small.btn-danger {
  border-color: #fecaca;
  color: #dc2626;
}

.btn-small.btn-danger:hover {
  background: #fee2e2;
}

/* Full-size danger button */
.btn.btn-danger {
  background: #dc2626;
  color: white;
}

.btn.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Config actions */
.config-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

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

.config-info {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
  text-align: center;
}

.history-info {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

.history-info strong {
  color: #0066cc;
}

#history-table-container {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table thead {
  background: #f8f9fa;
  position: sticky;
  top: 0;
}

.history-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: #1f2d3d;
  border-bottom: 2px solid #e5e7eb;
}

.history-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.history-table tbody tr:hover {
  background: #f8f9fa;
}

.history-table .empty-message {
  text-align: center;
  color: #888;
  padding: 30px 8px;
}

.history-table .message-cell {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table .message-cell:hover {
  white-space: normal;
  word-break: break-word;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.sent {
  background: #dcfce7;
  color: #16a34a;
}

.status-badge.failed {
  background: #fee2e2;
  color: #dc2626;
}

.status-badge.pending {
  background: #fef3c7;
  color: #d97706;
}

.status-badge.queued {
  background: #e0f2fe;
  color: #0284c7;
}

.status-badge.delivered {
  background: #dcfce7;
  color: #16a34a;
}

.status-badge.undelivered {
  background: #fee2e2;
  color: #dc2626;
}

.status-badge.canceled {
  background: #f3f4f6;
  color: #6b7280;
}

.error-tooltip {
  display: block;
  font-size: 10px;
  color: #dc2626;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .card-header {
    padding: 20px 20px 16px;
  }

  .card-header h1 {
    font-size: 20px;
  }

  .card-body {
    padding: 20px;
  }

  .tabs {
    flex-direction: column;
  }
}
