/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* Navbar */
.navbar {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 20px;
  font-weight: bold;
  color: #2196F3;
}

.navbar-menu {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #666;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
  background: #2196F3;
  color: white;
}

/* Main Content */
.content {
  padding: 30px 20px;
}

.content h1 {
  margin-bottom: 30px;
  color: #333;
  font-size: 28px;
}

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 15px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.stat-value {
  color: #333;
  font-size: 28px;
  font-weight: bold;
}

/* Status Bar */
.status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.status-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-label {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.status-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  background: #f0f0f0;
  color: #666;
}

.status-badge.online {
  background: #4CAF50;
  color: white;
}

.status-badge.offline {
  background: #f44336;
  color: white;
}

/* Metrics */
.metric-clicks { color: #2196F3; }
.metric-conversions { color: #4CAF50; }
.metric-cost { color: #f44336; }
.metric-revenue { color: #FF9800; }
.metric-roas { color: #00BCD4; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.table thead {
  background: #f9f9f9;
  border-bottom: 2px solid #eee;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  color: #666;
  font-weight: 600;
  font-size: 13px;
}

.table tbody tr:hover {
  background: #f9f9f9;
}

.campaign-table td {
  font-size: 14px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  margin: 5px;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
  background: #2196F3;
}

.btn-danger {
  background: #f44336;
}

.btn-warning {
  background: #FF9800;
}

.btn-secondary {
  background: #666;
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Alerts */
.alert {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid #ccc;
}

.alert-info {
  background: #E3F2FD;
  color: #1565C0;
  border-left-color: #2196F3;
}

.alert-success {
  background: #E8F5E9;
  color: #2E7D32;
  border-left-color: #4CAF50;
}

.alert-error {
  background: #FFEBEE;
  color: #C62828;
  border-left-color: #f44336;
}

.alert-warning {
  background: #FFF3E0;
  color: #F57C00;
  border-left-color: #FF9800;
}

/* Actions */
.actions {
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  display: flex;
  gap: 10px;
}

/* Loading */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid,
  .status-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar {
    flex-direction: column;
    gap: 15px;
  }

  .navbar-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 12px;
  }
}
