/* Basic layout fixes */
:root {
  --primary: #0071e3;
  --sidebar-width: 250px;
  --secondary: #86868b;
  --light-bg: #f5f5f7;
  --border-color: #d2d2d7;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --label-color: #6e6e73;
  --text-color: #1d1d1f;
  --success-color: #27c781;
  --warning-color: #ff9f0a;
  --danger-color: #ff453a;
  --info-color: #0c84ff;
  --header-height: 65px;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --radius-small: 8px;
  --radius-large: 12px;
}

body {
  font-family: "SF Pro Text", "SF Pro Icons", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light-bg);
  overflow-x: hidden;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout containers */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar styling */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.3s ease;
}

.sidebar-header {
  padding: 20px 15px;
  border-bottom: 1px solid #eaeaea;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-nav {
  padding: 15px 0;
}

.sidebar-link {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  margin-bottom: 5px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: #f5f5f7;
  color: var(--primary);
}

.sidebar-link i {
  margin-right: 10px;
}

/* Sidebar dropdown styles */
.sidebar-dropdown {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-dropdown.show {
  max-height: 300px; /* Adjust this value based on your content */
}

.sidebar-dropdown .sidebar-link {
  padding-left: 45px; /* Indent submenu items */
  font-size: 14px;
}

.sidebar-dropdown .sidebar-link i {
  font-size: 12px;
}

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid #eaeaea;
}

/* User avatar styling */
.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 20px;
  transition: margin-left 0.3s ease;
}

.top-navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 20px 0;
  position: relative;
}

.page-title {
  font-size: 24px;
  margin: 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Stats cards */
.stat-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: auto;
  overflow: hidden;
  min-width: 75px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  background-color: #f8f9fa;
}

.stat-card.clickable:active {
  transform: translateY(0);
  background-color: #f1f3f5;
}

@media (max-width: 576px) {
  .stat-card {
    padding: 16px;
    min-width: auto;
    text-align: center;
  }
  .stat-card .d-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin: 0;
    color: #1d1d1f;
  }
  .stat-card .stat-icon {
    display: flex;
    align-items: center;
  }
  .stat-card .stat-icon i {
    font-size: 28px;
    color: #0071e3;
    line-height: 1;
  }
  .stat-card .stat-title {
    font-size: 18px;
    color: #1d1d1f;
    margin: 0;
    font-weight: 500;
    width: 100%;
  }
}

.stat-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}

.stat-card .stat-icon {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin: 8px 0;
  color: #1d1d1f;
}

.stat-card .stat-icon i {
  color: #0071e3;
  font-size: 24px;
}

.stat-card .stat-title {
  color: #1d1d1f;
  font-size: 16px;
  margin: 0;
  text-align: center;
  font-weight: 600;
}

.stat-card .flex-grow-1 {
  margin-left: -40px;
}

.field-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.copy-btn {
    flex-shrink: 0;
}

.field-container h6 {
    margin-bottom: 0.5rem;
    color: #495057;
}

}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.stat-title {
  color: #86868b;
  margin: 5px 0 0 0;
}

/* Cards - Apple-inspired styling */
.card {
  background-color: #fff;
  border-radius: var(--radius-large);
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-weight: var(--font-weight-semibold);
  background-color: #fff;
  border-top-left-radius: var(--radius-large);
  border-top-right-radius: var(--radius-large);
}

.card-body {
  padding: 24px;
}

/* Additional card types */
.card.card-accent {
  border-left: 4px solid var(--primary);
}

.card-header h5 {
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

.card-footer {
  background-color: #fff;
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  border-bottom-left-radius: var(--radius-large);
  border-bottom-right-radius: var(--radius-large);
}

/* Button styling - Apple-inspired */
.btn {
  font-weight: var(--font-weight-semibold);
  padding: 10px 20px;
  border-radius: 980px; /* Very rounded corners like Apple buttons */
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 14px;
}

/* Mobile-friendly table styles */
.table-mobile {
  margin: 0;
  border-collapse: collapse;
  width: 100%;
}

.table-mobile th,
.table-mobile td {
  padding: 12px;
  vertical-align: middle;
}

@media (max-width: 576px) {
  .table-mobile th,
  .table-mobile td {
    padding: 8px;
    font-size: 14px;
  }

  .table-mobile .btn {
    padding: 4px 10px;
    font-size: 12px;
  }
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #0062cc;
  border-color: #0062cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Success, warning, and danger buttons */
.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

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

.btn-info {
  background-color: var(--info-color);
  border-color: var(--info-color);
}

/* Form styling - Apple-inspired */
.form-label {
  font-weight: var(--font-weight-semibold);
  color: var(--label-color);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-control {
  border-radius: var(--radius-small);
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.form-control::placeholder {
  color: #86868b;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Search form */
.search-form .form-control {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

/* Utilities */
.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

/* Additional elements */
.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 0;
}

.app-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

/* Sidebar toggle button styling - Apple-inspired */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 15px;
  left: 20px;
  z-index: 999;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--primary);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  width: auto;
  min-width: 90px;
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle i {
  margin-left: 8px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.sidebar {
  transition: left 0.3s;
}

.sidebar.collapsed {
  left: -230px;
}

.main-content {
  transition: margin-left 0.3s;
}

.main-content.expanded {
  margin-left: 0 !important;
}

/* Signature UI styling */
.signature-card {
  background-color: #f9f9fc;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.signature-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-check-input[type="checkbox"] {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  margin-right: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-check-input:checked[type="checkbox"] {
  background-color: var(--primary);
  border-color: var(--primary);
  background-size: 14px;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* Toggle switch styling */
.form-switch .form-check-input {
  height: 24px;
  width: 44px;
  border-radius: 24px;
  background-image: none;
  border: 2px solid #d1d1d6;
  background-color: #d1d1d6;
  transition: all 0.2s ease;
  position: relative;
}

.form-switch .form-check-input:checked {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.form-switch .form-check-input:focus {
  box-shadow: none;
  border-color: #d1d1d6;
}

.form-switch .form-check-input:checked:focus {
  border-color: var(--success-color);
}

/* Whitespace pre-line for transcript display */
.whitespace-pre-line {
  white-space: pre-line;
}

/* Mobile table styles */
.table-mobile td, .table-mobile th {
  padding: 8px !important;
}

@media (max-width: 576px) {
  .table-mobile td {
    font-size: 14px;
  }

  .table-mobile .d-none {
    display: none !important;
  }

  .table-responsive {
    margin: 0;
    padding: 0 8px;
    width: 100%;
  }
}

/* Responsive styles */
@media (max-width: 991px) {
  .sidebar {
    left: -230px;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

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

  .card-header, .card-body {
    padding: 16px;
  }
}
.modal-fullscreen .modal-content {
    min-height: 100vh;
    padding-top: 0;
    background-color: #f5f5f7;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    gap: 0.5rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.modal-header .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.813rem;
    background: none;
    border: none;
    color: #666;
    transition: color 0.2s ease;
}

.modal-header .btn:hover {
    color: #333;
}

.modal-title {
    flex: 1;
    margin: 0;
    font-size: 0.938rem;
    color: #333;
    font-weight: 500;
}

.modal-fullscreen .modal-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.recording-details {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
}

.recording-details h6 {
    color: #86868b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.recording-details p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #1d1d1f;
    font-weight: 500;
}

.recording-details .transcript-tabs {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 2rem;
}

.recording-details .nav-tabs {
    border: none;
    margin-bottom: 1rem;
}

.recording-details .nav-tabs .nav-link {
    border: none;
    color: #86868b;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
}

.recording-details .nav-tabs .nav-link.active {
    background-color: #f5f5f7;
    color: var(--primary);
}

.transcript-content {
    background-color: #f5f5f7;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.retention-switch {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #fff3dc;
    border-radius: 20px;
    color: #b88100;
    font-weight: 500;
    font-size: 0.9rem;
}

.retention-switch i {
    margin-right: 0.5rem;
}

/* ===== OFFLINE MODE & CONNECTION STATUS STYLES ===== */

/* Connection Status Indicator */
.connection-status-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    background-color: rgba(0, 0, 0, 0.72);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.connection-status-indicator:hover {
    background-color: rgba(0, 0, 0, 0.82);
    transform: translateY(-1px);
}
@media (prefers-color-scheme: dark) {
    .connection-status-indicator {
        background-color: rgba(255, 255, 255, 0.12);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    }
    .connection-status-indicator:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}


.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0;
}

.status-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: inherit;
}

/* Status variations */
.connection-status-indicator.status-online .status-dot {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(39, 199, 129, 0.2);
}

.connection-status-indicator.status-online .status-dot::after {
    background-color: var(--success-color);
}

.connection-status-indicator.status-offline .status-dot {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(255, 69, 58, 0.2);
}

.connection-status-indicator.status-offline .status-dot::after {
    background-color: var(--danger-color);
}

.connection-status-indicator.status-limited .status-dot {
    background-color: var(--warning-color);
    box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.2);
}

.connection-status-indicator.status-limited .status-dot::after {
    background-color: var(--warning-color);
}

.connection-status-indicator.status-checking .status-dot {
    background-color: var(--info-color);
    box-shadow: 0 0 0 2px rgba(12, 132, 255, 0.2);
}

.connection-status-indicator.status-checking .status-dot::after {
    background-color: var(--info-color);
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--danger-color), #e74c3c);
    color: white;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    z-index: 2000;
    display: none;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.offline-banner.show {
    display: block;
    transform: translateY(0);
}

.offline-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.offline-banner i.bi-wifi-off {
    font-size: 18px;
    animation: pulse 2s infinite;
}

.offline-message {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.offline-message span {
    font-size: 12px;
    opacity: 0.9;
}

.offline-banner .btn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Adjust content when offline banner is shown */
body.offline-mode {
    padding-top: 50px;
}

body.offline-mode .app-container {
    margin-top: 0;
}

/* Pulse animation for status indicators */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* UI State Management - Offline Element Styles */
.offline-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    position: relative;
}

.offline-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    border-radius: inherit;
}

.limited-connectivity {
    border: 1px solid var(--warning-color) !important;
    background-color: rgba(255, 159, 10, 0.1) !important;
}

.limited-connectivity:hover {
    background-color: rgba(255, 159, 10, 0.2) !important;
}

/* Offline form message styling */
.offline-form-message {
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid var(--warning-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Network-dependent element indicators */
[data-requires-network="true"]:not(.offline-disabled) {
    position: relative;
}

[data-requires-network="true"]:not(.offline-disabled)::before {
    content: '🌐';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .connection-status-indicator {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .status-dot {
        width: 8px;
        height: 8px;
        margin-right: 0.4rem;
    }

    .offline-banner-content {
        flex-direction: column;
        gap: 8px;
    }

    .offline-message {
        text-align: center;
    }

    .offline-banner .btn {
        font-size: 11px;
        padding: 3px 6px;
    }

    .offline-form-message {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}
