/**
 * @fileoverview Common CSS - Shared styles for the Universal AI Cloud web interface
 *
 * This module provides common CSS styling for the Universal AI Cloud web interface components,
 * including layout, forms, buttons, cards, alerts, modals, and other UI elements.
 * It serves as the foundation for consistent styling across all backdoor interfaces.
 *
 * @module common-css
 * @author Universal AI Cloud Development Team
 * @version 1.3.0
 *
 * @license MIT
 * @copyright (c) 2025 Universal AI Cloud Development Team
 *
 * Version History:
 * - 1.0.0 (2025-07-30): Initial documentation
 *   - Comprehensive styling for UI components
 *   - Support for forms, buttons, cards, and alerts
 *   - Modal and dialog styling
 *   - Table and grid layout components
 * - 1.1.0 (2025-12-02): Expanded shared styles
 *   - Added reset and base styles
 *   - Added sidebar and navigation components
 *   - Added login/welcome screens
 *   - Added pagination
 *   - Added generic form components
 *   - Added responsive utilities
 * - 1.2.0 (2025-12-02): Sidebar architecture cleanup
 *   - Removed generic sidebar styles (moved to page-specific CSS)
 *   - Dashboard sidebar now in dashboard.css
 *   - Companion sidebar now in companion.css
 *   - Each page defines its own sidebar implementation
 * - 1.3.0 (2026-01-13): Mobile and modal enhancements
 *   - Added text-size-adjust for mobile compatibility
 *   - Added spinner animation styles with visibility toggle
 *   - Added modal notification container and actions layout
 *   - Added modal refresh button with spinning animation
 */

/* ===================================================================
   RESET AND BASE STYLES
   =================================================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #f5f5f5;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
  color: #2c3e50;
  margin-top: 0;
}

/* ===================================================================
   LAYOUT COMPONENTS
   =================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.header h1 {
  margin: 0;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #667eea;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: #5568d3;
}

.btn-secondary {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #7f8c8d;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

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

.btn-success {
  color: #fff;
  background-color: #28a745;
  border-color: #28a745;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.btn-green {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #27ae60;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-green:hover {
  background-color: #229954;
}

.btn-red {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #e74c3c;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-red:hover {
  background-color: #c0392b;
}

.btn-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #95a5a6;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.btn-close:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* ===================================================================
   FORMS
   =================================================================== */

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #7f8c8d;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.submit-button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 4px;
  background-color: #667eea;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.submit-button:hover:not(:disabled) {
  background-color: #5568d3;
}

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

.error-message {
  color: #e74c3c;
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

/* ===================================================================
   CARDS
   =================================================================== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 1.25rem;
}

/* ===================================================================
   ALERTS
   =================================================================== */

.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

.error-notification,
.success-notification {
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: 500;
  animation: slideInDown 0.3s ease-out;
}

.error-notification {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.success-notification {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===================================================================
   UTILITIES
   =================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 1rem;
}

.hidden {
  display: none;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
}

.spinner.visible {
  opacity: 1;
  visibility: visible;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ===================================================================
   MODALS
   =================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;  /* Use height instead of bottom:0 to prevent moving with iOS keyboard */
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  transform: translateZ(0);  /* Hardware acceleration for stable fixed positioning on iOS */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-dialog {
  position: relative;
  width: 500px;
  max-width: 90%;
  margin: 1.75rem auto;
  pointer-events: none;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: min(90vh, calc(100% - 40px));  /* Constrain within safe area padding */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
  position: relative;
  pointer-events: auto;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  outline: 0;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 0.3rem;
  border-top-right-radius: 0.3rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
  line-height: 1.5;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #7f8c8d;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #2c3e50;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  position: relative;
}

.modal-body.notifications {
  padding: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-content-sm {
  max-width: 400px;
}

.modal-refresh {
  background: none;
  border: none;
  cursor: pointer;
  color: #7f8c8d;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.2s ease;
}

.modal-refresh:hover {
  color: #2c3e50;
}

.modal-refresh.spinning {
  animation: modal-spin 0.6s linear;
}

@keyframes modal-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.modal-refresh img {
  width: 20px;
  height: 20px;
}

.modal-footer {
  border-top: 1px solid #e0e0e0;
  padding: 0 10px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  background: white;
  flex-shrink: 0;
  height: 0;
  opacity: 0;
  visibility: hidden;
  transition: height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, visibility 0s 0.3s;
}

.modal-footer.visible {
  height: auto;
  opacity: 1;
  visibility: visible;
  padding: 10px;
  transition: height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, visibility 0s 0s;
}

/* Notification/List Item Styles */
.no-notifications {
  text-align: center;
  padding: 40px 20px;
  color: #95a5a6;
}

.notification-item {
  padding: 15px;
  display: flex;
  gap: 12px;
  transition: background 0.2s ease;
  cursor: pointer;
  position: relative;
}

.notification-item:not(:last-child) {
  border-bottom: 1px solid #e0e0e0;
}

.notification-item:hover {
  background: #f5f5f5;
}

.notification-left-area {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
}

.notification-indicator {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3498db;
}

.notification-indicator.read {
  background: transparent;
}

.notification-checkmark {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.notification-item.selected .notification-checkmark {
  opacity: 1;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-type {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-bottom: 4px;
}

.notification-text {
  font-size: 0.95rem;
  color: #2c3e50;
  line-height: 1.4;
}

.notification-text strong {
  font-weight: 600;
}

.notification-title {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-bottom: 4px;
}

.notification-meta {
  font-size: 0.85rem;
  color: #95a5a6;
}

.notification-action-text {
  color: #2c3e50;
  margin-right: auto;
}

.notification-action-link {
  font-weight: 600;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  transition: background 0.2s ease;
  border-radius: 4px;
}

.notification-action-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ===================================================================
   TABLES
   =================================================================== */

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #212529;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
}

.table tbody+tbody {
  border-top: 2px solid #dee2e6;
}

/* Generic Data Table Styles */
.data-table-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.data-table th {
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

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

.data-table td {
  padding: 4px 8px;
  color: #333;
  font-size: 0.9rem;
}

/* ===================================================================
   MARKDOWN CONTENT
   =================================================================== */

.markdown ul,
.markdown ol {
  padding-left: 2rem;
  margin: 0.5em 0;
}

.markdown li {
  margin-bottom: 0.25em;
}

.markdown li:last-child {
  margin-bottom: 0;
}

.markdown ul ul,
.markdown ul ol,
.markdown ol ul,
.markdown ol ol {
  margin: 0.25em 0;
}

.markdown li>p:last-child {
  margin-bottom: 0;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75em 0;
  border: 1px solid #ddd;
}

.markdown th,
.markdown td {
  padding: 0.5em 0.75em;
  text-align: left;
  border: 1px solid #ddd;
}

.markdown th {
  background-color: #f8f9fa;
  font-weight: 600;
}

/* ===================================================================
   NAVIGATION
   =================================================================== */

.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-item {
  margin-right: 1rem;
}

.nav-link {
  color: #007bff;
  text-decoration: none;
  background-color: transparent;
}

.nav-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}


/* ===================================================================
   LOGIN/WELCOME SCREENS
   =================================================================== */

.welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.welcome-content {
  padding: 40px;
}

.welcome-content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #2c3e50;
}

.welcome-content p {
  font-size: 1.2rem;
  color: #7f8c8d;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.login-form {
  background-color: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
}

.login-form h2 {
  margin-bottom: 30px;
  color: #2c3e50;
  text-align: center;
}

/* ===================================================================
   CONTENT SECTIONS
   =================================================================== */

.content-section {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-section h1 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.content-section p {
  line-height: 1.6;
  color: #555;
}

.no-file-selected {
  background-color: white;
  padding: 60px 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.no-file-selected p {
  font-size: 1.1rem;
  color: #7f8c8d;
}

.error-container {
  background-color: white;
  padding: 60px 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.error-container h2 {
  color: #e74c3c;
  margin-bottom: 15px;
}

.error-container p {
  color: #7f8c8d;
  font-size: 1.1rem;
}

/* ===================================================================
   PAGINATION
   =================================================================== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 20px 0;
}

.pagination-info {
  color: #555;
  font-size: 0.95rem;
}

/* ===================================================================
   GENERIC FORM COMPONENTS
   Reusable form layouts and components for modals and forms
   =================================================================== */

/* Form Row - Generic container for form elements in a row */
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="tel"],
.form-row select,
.form-row textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-row-label {
  flex-shrink: 0;
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95rem;
}

/* Form Row with stretching input */
.form-row-stretch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row-stretch input[type="text"],
.form-row-stretch input[type="email"],
.form-row-stretch input[type="password"],
.form-row-stretch input[type="number"],
.form-row-stretch input[type="tel"],
.form-row-stretch select,
.form-row-stretch textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.form-row-stretch input:focus,
.form-row-stretch select:focus,
.form-row-stretch textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Form Row Header - Label on left, control on right */
.form-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row-header .form-row-label {
  margin: 0;
}

/* Form control modifiers for stretching/fixed behavior */
.form-control-stretch {
  flex: 1;
}

.form-control-fixed {
  flex-shrink: 0;
  width: auto;
}

.form-row-header input,
.form-row-header select,
.form-row-header textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.form-row-header input:focus,
.form-row-header select:focus,
.form-row-header textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Chip container - for labels, tags, etc. */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 12px;
}

.chip-container:empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-container:empty::before {
  content: "No items added";
  color: #95a5a6;
  font-style: italic;
  font-size: 0.9rem;
}

/* Chip - individual label/tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #667eea;
  color: white;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.chip-remove:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Form Section - Groups related form fields */
.form-section {
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  margin-bottom: 20px;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="password"],
.form-section input[type="number"],
.form-section input[type="tel"],
.form-section select,
.form-section textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-section-title {
  font-weight: 600;
  font-size: 1rem;
  color: #2c3e50;
  margin-bottom: 16px;
}

/* Compact form controls - no stretching */
.form-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row-compact>* {
  flex-shrink: 0;
}

.form-row-compact input[type="text"],
.form-row-compact input[type="email"],
.form-row-compact input[type="password"],
.form-row-compact input[type="number"],
.form-row-compact input[type="tel"],
.form-row-compact select,
.form-row-compact textarea {
  width: auto;
  min-width: 80px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.form-row-compact input:focus,
.form-row-compact select:focus,
.form-row-compact textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Consistent dropdown arrow styling for all select elements */
.form-row select,
.form-row-stretch select,
.form-row-header select,
.form-row-compact select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 35px;
}

/* ===================================================================
   RESPONSIVE STYLES
   =================================================================== */

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .pagination {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .data-table-container {
    overflow-x: auto;
  }
}

/* Clickable value - minimal button for editable values */
.clickable-value {
  padding: 2px 6px;
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-value:hover {
  background-color: #e0e0e0;
}

/* ===================================================================
   CHECKBOX LIST
   Scrollable container for checkbox items (skills, features, calendars, etc.)
   =================================================================== */

.checkbox-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.checkbox-list--white {
  background-color: white;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.checkbox-item:last-child {
  margin-bottom: 0;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.checkbox-item span {
  flex: 1;
}

.checkbox-item--default {
  font-weight: 600;
  color: #667eea;
}

/* ===================================================================
   SUBITEM
   Nested content blocks within record-content (gray default, blue variant)
   =================================================================== */

.subitem {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 4px;
  line-height: 1.6;
  background-color: #f5f5f5;
  border-left: 4px solid #9e9e9e;
}

.subitem:last-child {
  margin-bottom: 0;
}

.subitem--blue {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
}