/**
 * AI Command Center — Responsive Styles
 * Mobile, tablet, and adaptive viewport breakpoints.
 */
/* Mobile Segmented View Switcher */
.mobile-tab-bar {
  display: none;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 0.25rem;
}

.mobile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Responsive Utilities & Mobile App Optimization */
@media (max-width: 1680px) {
  .app-header {
    padding: 0.45rem 0.65rem;
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.5rem;
  }

  .header-center {
    display: none !important; /* Hide center telemetry on laptops and medium desktops so action menus never overflow */
  }

  .header-right {
    flex: 1;
    justify-content: flex-end;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .btn-action-pill {
    padding: 0 0.52rem;
    font-size: 0.74rem;
  }
}

@media (max-width: 1300px) {
  .btn-action-pill {
    padding: 0 0.45rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }
  .health-chip {
    padding: 0 0.35rem;
    font-size: 0.62rem;
  }
  .global-company-bar {
    padding: 0 0.45rem 0 0.4rem;
  }
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 320px 1fr;
  }
  .logo-text span.version-tag {
    display: none;
  }
}

@media (max-width: 1100px) {
  .header-center {
    display: none !important;
  }

  .header-right {
    flex: 1;
    justify-content: flex-end;
  }

  .global-company-bar .gcb-label {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom)) 0.5rem;
    gap: 0.5rem;
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Header & Navigation Mobile Layout */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
    gap: 0.55rem;
    border-radius: 14px;
  }

  .header-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .logo-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .logo-icon svg {
    width: 18px;
    height: 18px;
  }

  .logo-text h1 {
    font-size: 0.95rem;
    letter-spacing: 0.05em;
  }

  .version-tag {
    font-size: 0.6rem;
    padding: 1px 5px;
  }

  /* Global Company Bar on mobile */
  .global-company-bar {
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.6rem;
    height: 36px;
    gap: 0.5rem;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 10px;
  }

  .gcb-select-wrap {
    flex: 1;
    min-width: 0;
  }

  #globalCompanySelect {
    width: 100%;
    max-width: none;
    min-width: 0;
    font-size: 0.82rem;
  }

  .company-lock-btn {
    padding: 0 0.55rem;
    height: 26px;
    font-size: 0.7rem;
  }

  /* Executive Metrics on mobile */
  .header-center {
    display: flex !important;
    width: 100%;
    justify-content: space-around;
    padding: 0 0.4rem;
    height: 34px;
    order: 3;
  }

  .header-center .stat-widget {
    flex: 1;
    min-width: 0;
    padding: 0 0.2rem;
    gap: 0.25rem;
    justify-content: center;
  }

  .header-center .stat-icon {
    font-size: 0.8rem;
  }

  .header-center .stat-value {
    font-size: 0.78rem;
  }

  .header-center .stat-label {
    display: inline;
    font-size: 0.56rem;
    letter-spacing: 0.02em;
  }

  /* Header Right & Actions on mobile */
  .header-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    width: 100%;
    order: 4;
  }

  .health-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .health-chip {
    padding: 0 0.5rem;
    height: 30px;
    font-size: 0.62rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
    width: 100%;
    position: relative;
  }

  #btnOpenDailyProgress {
    grid-column: span 3;
    width: 100%;
    height: 36px;
    font-size: 0.74rem;
    padding: 0 0.4rem;
    justify-content: center;
  }

  #btnOpenGrowthMission {
    grid-column: span 3;
    width: 100%;
    height: 36px;
    font-size: 0.74rem;
    padding: 0 0.4rem;
    justify-content: center;
  }

  .header-actions .settings-dropdown-wrapper {
    position: static;
  }

  .header-actions .settings-dropdown-wrapper:nth-of-type(1) {
    grid-column: span 2;
  }

  .header-actions .settings-dropdown-wrapper:nth-of-type(2) {
    grid-column: span 2;
  }

  .header-actions .settings-dropdown-wrapper:nth-of-type(3) {
    grid-column: span 2;
  }

  .settings-dropdown-wrapper .btn-action-pill,
  .settings-dropdown-wrapper .btn {
    width: 100%;
    height: 36px;
    font-size: 0.72rem;
    padding: 0 0.25rem;
    justify-content: center;
  }

  .settings-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    z-index: 99999;
  }

  /* Sticky Segmented Mobile Tab Bar */
  .mobile-tab-bar {
    display: flex;
    position: sticky;
    top: 0.5rem;
    z-index: 150;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-tab-btn {
    flex: 1;
    min-height: 40px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }

  /* Workspace & Panels Layout */
  .workspace {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    height: auto;
  }

  .panel.mobile-hidden {
    display: none !important;
  }

  .control-panel {
    max-height: none;
    overflow-y: visible;
    padding: 0.85rem;
  }

  .execution-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 0.85rem;
  }

  .task-tree {
    max-height: none;
    overflow-y: visible;
    padding: 0.4rem 0 1rem 0;
  }

  /* Task Card Mobile Tweaks */
  .task-card {
    padding: 0.85rem 0.95rem;
    gap: 0.55rem;
    border-radius: 10px;
  }

  .task-card-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .task-title {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .task-meta {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  /* Orchestration Toolbar */
  .orchestration-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
    gap: 0.6rem;
  }

  .filter-bar {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 3px;
    gap: 0.25rem;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .toolbar-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .company-filter-box {
    width: 100%;
  }

  .company-filter-box select {
    flex: 1;
    width: 100%;
  }

  .search-box {
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }

  /* Form inputs mobile touch optimization */
  .form-group input, 
  .form-group select, 
  .form-group textarea {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom */
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
  }

  #btnDispatch {
    min-height: 44px;
    font-size: 0.9rem;
    width: 100%;
  }

  .role-cards-grid {
    gap: 0.35rem;
  }

  .role-card-option {
    padding: 0.55rem 0.35rem;
    min-height: 52px;
  }

  /* Mobile Slide-Up Bottom Drawer Modals */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 92vh !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    animation: slideUpBottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slideUpBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-header {
    padding: 0.85rem 1.1rem;
    flex-shrink: 0;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1.3rem;
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 1rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1;
    min-height: 42px;
  }

  .children-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-phases-grid {
    grid-template-columns: 1fr;
  }
}


/* Google Ads authentication method */
.google-auth-method-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1.5fr;
  gap: 0.85rem;
  align-items: end;
  padding: 0.9rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 10px;
}

.google-auth-method-card label,
#googleIntegrationFormPage label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

#googleIntegrationFormPage input,
#googleIntegrationFormPage select,
#googleIntegrationFormPage textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.55rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

#googleIntegrationFormPage textarea {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  resize: vertical;
  line-height: 1.45;
}

#googleIntegrationFormPage input:focus,
#googleIntegrationFormPage select:focus,
#googleIntegrationFormPage textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.google-auth-help {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.google-auth-help code {
  font-family: var(--font-mono);
  color: #a5f3fc;
}

.field-optional {
  color: var(--text-dim);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

@media (max-width: 800px) {
  .google-auth-method-card {
    grid-template-columns: 1fr;
  }
}

