* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  position: relative;
}

.connection-error {
  background: rgba(231, 76, 60, 0.9);
  color: white;
  padding: 10px 20px;
  margin-top: 15px;
  border-radius: 8px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pulse 2s infinite;
}

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

.header h1 {
  font-size: 2em;
  margin-bottom: 20px;
}

.header-stats {
  display: flex;
  gap: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 0.85em;
  opacity: 0.9;
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
}

.tabs {
  display: flex;
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
}

.tab {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
}

.tab:hover {
  background: #e0e0e0;
}

.tab.active {
  background: white;
  color: #667eea;
  border-bottom: 3px solid #667eea;
}

.content {
  padding: 30px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

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

/* Domains Grid */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.domain-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  border-left: 4px solid #667eea;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.domain-card h3 {
  color: #667eea;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.domain-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.domain-stat-label {
  font-size: 0.85em;
  color: #666;
}

.domain-stat-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
}

.domain-stat-value.success {
  color: #27ae60;
}

.domain-stat-value.warning {
  color: #f39c12;
}

.domain-stat-value.error {
  color: #e74c3c;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  transition: width 0.3s;
}

.progress-fill.low {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.progress-fill.medium {
  background: linear-gradient(90deg, #f39c12, #e67e22);
}

/* Proxies List */
.proxies-list {
  display: grid;
  gap: 15px;
}

.proxy-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proxy-info h4 {
  margin-bottom: 5px;
  color: #333;
}

.proxy-info p {
  color: #666;
  font-size: 0.9em;
}

.proxy-stats {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.proxy-stat {
  display: flex;
  flex-direction: column;
}

.proxy-stat-label {
  font-size: 0.8em;
  color: #666;
}

.proxy-stat-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
}

/* Domain Detail */
.domain-detail {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.proxy-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

.proxy-table th {
  background: #667eea;
  color: white;
  padding: 15px;
  text-align: left;
}

.proxy-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
}

.proxy-table tr:hover {
  background: #f5f5f5;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.btn-success {
  background: #27ae60;
  color: white;
  padding: 8px 16px;
  font-size: 0.9em;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  padding: 8px 16px;
  font-size: 0.9em;
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.85em;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: 500;
}

.badge-success {
  background: #d5f4e6;
  color: #27ae60;
}

.badge-warning {
  background: #ffeaa7;
  color: #e67e22;
}

.badge-danger {
  background: #ffcccc;
  color: #e74c3c;
}

.badge-info {
  background: #dfe6e9;
  color: #2d3436;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
}

.close:hover {
  color: #333;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #27ae60;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading:after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
  .header-stats {
    flex-direction: column;
  }

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

  .domain-stats {
    grid-template-columns: 1fr;
  }
}



