/* Unified Google Ads Page Styles */
.ads-unified-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f8f9fa;
}

/* Top Bar */
.ads-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.ads-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.ads-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-selector select,
.period-selector select {
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #24292f;
  min-width: 150px;
}

.btn-refresh {
  padding: 8px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: white;
  color: #656d76;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: #f6f8fa;
  color: #24292f;
}

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

.spinning {
  animation: spin 1s linear infinite;
}

/* Navigation */
.ads-nav {
  background: white;
  border-bottom: 1px solid #e9ecef;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ads-nav::-webkit-scrollbar {
  display: none;
}

.ads-nav-tabs {
  display: flex;
  padding: 0 24px;
  min-width: max-content;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border: none;
  background: none;
  color: #656d76;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #24292f;
  background: #f6f8fa;
}

.nav-tab.active {
  color: #0969da;
  border-bottom-color: #0969da;
}

.nav-icon {
  font-size: 16px;
}

.nav-label {
  font-weight: 500;
}

/* Main Content */
.ads-main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

/* Overview View */
.overview-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.metric-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

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

.metric-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f8f9fa;
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.metric-label {
  font-size: 14px;
  color: #656d76;
  margin-top: 4px;
}

/* Campaigns View */
.campaigns-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.campaigns-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.campaigns-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.btn-primary {
  padding: 10px 16px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #0860ca;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  font-size: 16px;
  color: #656d76;
}

.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.skeleton-card {
  height: 120px;
  background: #f6f8fa;
  border-radius: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 20px;
  background: #f6f8fa;
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line:nth-child(1) { width: 60%; }
.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 40%; }

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .ads-top-bar {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .ads-controls {
    width: 100%;
    justify-content: space-between;
  }

  .ads-nav-tabs {
    padding: 0 16px;
  }

  .nav-tab {
    padding: 12px 16px;
  }

  .nav-label {
    display: none;
  }

  .ads-main-content {
    padding: 16px;
  }

  .metric-cards {
    grid-template-columns: 1fr;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
  }

  .metric-value {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .ads-header h1 {
    font-size: 20px;
  }

  .ads-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .account-selector select,
  .period-selector select {
    min-width: auto;
    width: 100%;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 12px 8px;
  }
}

/* Error States */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.view-placeholder {
  text-align: center;
  padding: 80px 20px;
  color: #656d76;
  font-size: 16px;
}

/* Accessibility */
.nav-tab:focus,
.btn-refresh:focus,
.account-selector select:focus,
.period-selector select:focus {
  outline: 2px solid #0969da;
  outline-offset: 2px;
}

/* Campaigns Table */
.campaigns-table-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.table-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.table-filters select,
.table-filters input {
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
}

.table-filters input {
  min-width: 200px;
}

.btn-secondary {
  padding: 8px 16px;
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  color: #24292f;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f6f8fa;
}

.campaigns-table {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 40px 2fr 100px 120px 100px 120px 80px 120px;
  align-items: center;
  padding: 12px 20px;
}

.table-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #656d76;
}

.table-row {
  border-bottom: 1px solid #f1f3f4;
  transition: background 0.2s;
}

.table-row:hover {
  background: #f8f9fa;
}

.th {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.th:hover .sort-icon {
  opacity: 1;
}

.sort-icon {
  opacity: 0.5;
  font-size: 10px;
}

.td {
  display: flex;
  align-items: center;
}

.campaign-name strong {
  color: #24292f;
  font-weight: 600;
}

.campaign-type {
  font-size: 12px;
  color: #656d76;
  margin-top: 2px;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.roas-value {
  font-weight: 600;
}

.roas-good { color: #28a745; }
.roas-ok { color: #ffc107; }
.roas-poor { color: #dc3545; }

.action-buttons {
  display: flex;
  gap: 4px;
}

.btn-icon {
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: #f6f8fa;
}

/* Bulk Actions */
.bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #e3f2fd;
  border-top: 1px solid #2196f3;
}

.bulk-info {
  font-size: 14px;
  font-weight: 600;
  color: #1976d2;
}

.bulk-buttons {
  display: flex;
  gap: 8px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  color: #24292f;
  margin: 0 0 8px 0;
}

.empty-state p {
  color: #656d76;
  margin: 0 0 24px 0;
}

/* Breakdown Sections */
.breakdown-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
}

.breakdown-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #24292f;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.account-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  background: #f8f9fa;
}

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

.account-header h4 {
  margin: 0;
  color: #24292f;
}

.account-currency {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #656d76;
}

.account-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-metric {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.account-metric .metric-label {
  color: #656d76;
}

.account-metric .metric-value {
  font-weight: 600;
  color: #24292f;
}

/* Channels Chart */
.channels-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-bar {
  display: grid;
  grid-template-columns: 150px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.channel-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.channel-value {
  font-weight: 600;
  color: #24292f;
}

.channel-progress {
  height: 8px;
  background: #f1f3f4;
  border-radius: 4px;
  overflow: hidden;
}

.channel-fill {
  height: 100%;
  background: linear-gradient(90deg, #0969da, #2ea043);
  transition: width 0.3s ease;
}

.channel-percentage {
  text-align: right;
  font-size: 12px;
  color: #656d76;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #656d76;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 0 20px 20px;
}

/* Forms */
.campaign-form h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: #24292f;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #24292f;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Placeholder Content */
.placeholder-content {
  text-align: center;
  padding: 80px 20px;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.placeholder-content h3 {
  font-size: 20px;
  color: #24292f;
  margin: 0 0 8px 0;
}

.placeholder-content p {
  color: #656d76;
  margin: 0;
  font-size: 16px;
}

/* Analytics Tabs */
.analytics-tabs {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.analytics-tab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: #656d76;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.analytics-tab:hover {
  color: #24292f;
  background: #f6f8fa;
}

.analytics-tab.active {
  color: #0969da;
  border-bottom-color: #0969da;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .table-header,
  .table-row {
    grid-template-columns: 40px 2fr 80px 100px 80px 100px 60px 100px;
  }
}

@media (max-width: 768px) {
  .table-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .table-filters {
    justify-content: space-between;
  }

  .table-filters input {
    min-width: auto;
    flex: 1;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .table-header > *:not(.th-name),
  .table-row > *:not(.td-name) {
    display: none;
  }

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

  .channel-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bulk-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
}

/* Print styles */
@media print {
  .ads-top-bar,
  .ads-nav {
    display: none;
  }

  .ads-main-content {
    padding: 0;
    max-height: none;
  }

  .metric-card {
    break-inside: avoid;
  }
}

/* Loading Animation - using existing spin animation defined above */

/* Improved Button Styles */
.btn-primary, .btn-secondary {
  transition: all 0.2s ease;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: #2563eb;
  color: white;
  border: 1px solid #2563eb;
  padding: 10px 16px;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: #1d1d1f;
  border: 1px solid #e2e8f0;
  padding: 10px 16px;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #2563eb;
}

.btn-primary:disabled, .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}