*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  color: #0f172a;
  background: radial-gradient(circle at top left, #0f172a, #020617 45%, #020617);
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  width: 100%;
  max-width: 1400px;
  margin: 24px;
  border-radius: 24px;
  background: linear-gradient(145deg, #020617 0%, #020617 50%, #020617 100%);
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  box-shadow:
    0 24px 80px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.ts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: radial-gradient(circle at top left, #0f172a, #020617);
}

.ts-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ts-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: conic-gradient(
    from 180deg at 50% 50%,
    #22c55e,
    #06b6d4,
    #6366f1,
    #22c55e
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #0b1220;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    0 0 40px rgba(56, 189, 248, 0.8);
}

.ts-logo-text h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.ts-logo-text p {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.ts-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ts-user-info {
  font-size: 13px;
  color: #e5e7eb;
  max-width: 190px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.ts-subscription-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.15);
  color: #a5f3fc;
  border: 1px solid rgba(45, 212, 191, 0.35);
}

.ts-subscription-badge.ts-subscription-active {
  background: rgba(22, 163, 74, 0.15);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
}

.ts-subscription-badge.ts-subscription-inactive {
  background: rgba(30, 64, 175, 0.12);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, 0.4);
}

.ts-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px 18px 12px;
}

.ts-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.ts-main-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ts-settings-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 18px 18px 12px;
}

.ts-panel-settings-page {
  max-width: 100%;
}

.ts-settings-item {
  margin-bottom: 16px;
}

.ts-settings-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 4px;
}

.ts-settings-value {
  font-size: 14px;
  color: #e5e7eb;
  padding: 8px 0;
}

.ts-user-info.ts-clickable {
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.ts-user-info.ts-clickable:hover {
  background: rgba(55, 65, 81, 0.5);
}

.ts-panel {
  background: radial-gradient(circle at top left, #020617, #020617 55%, #020617);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 16px 16px 14px;
  box-shadow:
    0 14px 45px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.ts-panel h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.ts-panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.ts-panel-settings {
  margin-top: auto;
  flex-shrink: 0;
}

.ts-settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ts-settings-section {
  padding: 12px 0;
  border-top: 1px solid rgba(55, 65, 81, 0.5);
}

.ts-settings-section:first-child {
  border-top: none;
  padding-top: 0;
}

.ts-settings-section h3 {
  margin-bottom: 8px;
}

.ts-settings-section:has(h3:contains("Danger")) h3,
.ts-settings-section h3:last-of-type {
  color: #ef4444;
}

.ts-panel-subtitle {
  margin: 0 0 10px;
  font-size: 12px;
  color: #9ca3af;
}

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

.ts-panel-header h2 {
  margin: 0;
  flex: 1;
}


/* FullCalendar widget container */
.ts-calendar-widget {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Map in tab */
#tab-map .ts-map {
  flex: 1;
  min-height: 400px;
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.7);
  overflow: hidden;
}

/* FullCalendar dark theme overrides */
.fc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #e5e7eb;
}

.fc-theme-standard td,
.fc-theme-standard th {
  border-color: rgba(55, 65, 81, 0.5);
}

.fc-theme-standard .fc-scrollgrid {
  border-color: rgba(55, 65, 81, 0.5);
  background: transparent;
}

/* Calendar header */
.fc-header-toolbar {
  margin-bottom: 12px;
  padding: 0 4px;
}

.fc-toolbar-title {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
}

.fc-button {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.fc-button:hover {
  background: rgba(31, 41, 55, 0.9);
  border-color: rgba(56, 189, 248, 0.5);
}

.fc-button:active,
.fc-button:focus {
  background: rgba(31, 41, 55, 0.9);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
}

/* Day headers */
.fc-col-header-cell {
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 4px;
}

.fc-col-header-cell-cushion {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Day cells */
.fc-daygrid-day {
  background: radial-gradient(circle at top left, #020617, #020617);
}

.fc-daygrid-day-top {
  padding: 4px;
}

.fc-daygrid-day-number {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  padding: 4px;
}

.fc-day-today {
  background: rgba(56, 189, 248, 0.1) !important;
}

.fc-day-today .fc-daygrid-day-number {
  color: #38bdf8;
  font-weight: 600;
}

/* Other month days */
.fc-day-other .fc-daygrid-day-number {
  opacity: 0.3;
}

/* Events */
.fc-event {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-event:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.6);
}

.fc-event-title {
  color: #033d18;
  font-size: 11px;
  font-weight: 500;
  padding: 0;
}

.ts-calendar-event-editing {
  background: rgba(56, 189, 248, 0.3) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.ts-calendar-event-editing .fc-event-title {
  color: #38bdf8 !important;
}

/* More events link */
.fc-more-link {
  color: #38bdf8;
  font-size: 11px;
  padding: 2px 4px;
}

.fc-more-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Popover */
.fc-popover {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.9);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.fc-popover-header {
  background: rgba(31, 41, 55, 0.8);
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
  padding: 8px 12px;
}

.fc-popover-title {
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
}

.fc-popover-close {
  color: #9ca3af;
  opacity: 0.8;
}

.fc-popover-close:hover {
  color: #e5e7eb;
  opacity: 1;
}

/* Make calendar fit on screen */
.fc-scroller {
  overflow-y: auto;
  overflow-x: hidden;
}

.fc-scroller::-webkit-scrollbar {
  width: 6px;
}

.fc-scroller::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 3px;
}

.fc-scroller::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 3px;
}

.fc-scroller::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

.ts-panel-tabs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* jQuery UI Tabs styling */
.ts-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ui-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ui-tabs-nav {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0 16px;
  margin: 0;
  display: flex;
  gap: 4px;
}

.ui-tabs-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  top: 0;
  float: none;
  border: none;
  background: transparent;
}

.ui-tabs-nav li a {
  display: block;
  padding: 12px 20px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.ui-tabs-nav li a:hover {
  color: #e5e7eb;
  background: rgba(31, 41, 55, 0.5);
}

.ui-tabs-nav li.ui-state-active a {
  color: #38bdf8;
  background: transparent;
  border-bottom-color: #38bdf8;
}

.ui-tabs-panel {
  flex: 1;
  min-height: 0;
  padding: 16px;
  background: transparent;
  border: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ts-tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.ts-tab-header h2 {
  margin: 0;
  font-size: 15px;
}

.ts-tab-header .ts-panel-subtitle {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.ts-panel-map {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ts-map {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.7);
  overflow: hidden;
  min-height: 400px;
}

.ts-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  font-size: 12px;
  color: #e5e7eb;
}

input[type='text'],
input[type='date'],
input[type='number'] {
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617);
  color: #f9fafb;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

input::placeholder {
  color: #6b7280;
}

input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.ts-coords-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ts-help-text {
  margin: 0;
  font-size: 11px;
  color: #a1a1aa;
}

.ts-help-text-muted {
  color: #71717a;
}

.ts-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  padding: 7px 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: #e5e7eb;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
  outline: none;
}

.ts-btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.ts-btn-primary {
  background: linear-gradient(135deg, #22c55e, #22c55e, #06b6d4);
  border-color: rgba(34, 197, 94, 0.4);
  color: #022c22;
  box-shadow:
    0 12px 35px rgba(34, 197, 94, 0.3),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.ts-btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow:
    0 16px 45px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}

.ts-btn-ghost {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

.ts-btn-ghost:hover:not(:disabled) {
  background: rgba(31, 41, 55, 0.9);
  border-color: rgba(156, 163, 175, 0.8);
}

.ts-btn-small {
  padding-inline: 10px;
  font-size: 12px;
}

.ts-btn-full {
  width: 100%;
  margin-top: 6px;
}

.ts-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.ts-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171;
}

.ts-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ts-segment-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ts-segment-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, #020617, #020617);
  border: 1px solid rgba(55, 65, 81, 0.9);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ts-segment-item:hover {
  background-color: rgba(31, 41, 55, 0.6);
  border-color: rgba(56, 189, 248, 0.3);
}

.ts-segment-item-editing {
  background-color: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.ts-edit-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  font-weight: 500;
}

.ts-segment-index {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.6);
  color: #bfdbfe;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-segment-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ts-segment-location {
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.ts-segment-dates {
  font-size: 11px;
  color: #9ca3af;
}

.ts-segment-meta {
  font-size: 11px;
  color: #6b7280;
  text-align: right;
}

.ts-footer {
  padding: 10px 18px 14px;
  font-size: 11px;
  color: #6b7280;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Google Maps container */
#map {
  background: #f0f9ff; /* Bright light background */
}

/* Style Google Maps controls for bright theme */
.gm-style .gm-style-cc {
  color: #475569 !important;
}

.gm-style .gm-style-cc a {
  color: #475569 !important;
}

/* Custom info window styling - bright theme */
.gm-style .gm-style-iw-c {
  background: rgba(255, 255, 255, 0.98) !important;
  border-radius: 8px !important;
  padding: 0 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  color: #1e293b !important;
}

.gm-style .gm-style-iw-t::after {
  background: rgba(255, 255, 255, 0.98) !important;
}

/* Google Maps attribution - bright theme */
.gm-style-cc {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #475569 !important;
}

/* Google Places Autocomplete styling */
.pac-container {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(55, 65, 81, 0.9) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  margin-top: 4px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.pac-item {
  padding: 12px 16px !important;
  color: #e5e7eb !important;
  border-top: 1px solid rgba(55, 65, 81, 0.5) !important;
  cursor: pointer !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover {
  background-color: rgba(31, 41, 55, 0.8) !important;
}

.pac-item-selected {
  background-color: rgba(31, 41, 55, 0.8) !important;
}

.pac-icon {
  margin-right: 12px !important;
}

.pac-item-query {
  color: #e5e7eb !important;
  font-size: 14px !important;
}

.pac-matched {
  color: #38bdf8 !important;
  font-weight: 500 !important;
}

@media (max-width: 960px) {
  #app {
    margin: 16px;
  }

  .ts-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .ts-sidebar {
    order: 2;
  }

  .ts-map-section {
    order: 1;
  }
}

@media (max-width: 640px) {
  #app {
    margin: 0;
    border-radius: 0;
  }

  .ts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ts-header-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}


