/* Oracle Instance Creator Dashboard CSS */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --dark: #1f2937;
  --light: #f8fafc;
  --border: #e5e7eb;
  --text: #374151;
  --text-light: #6b7280;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Header */
.dashboard-header {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-section i {
  font-size: 2rem;
  color: var(--primary);
}

.logo-section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

.version {
  background: var(--success);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-indicators {
  display: flex;
  gap: 20px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.status-item i {
  color: var(--success);
  animation: pulse 2s infinite;
}

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

/* Main Dashboard */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.primary .stat-icon { background: var(--primary); }
.success .stat-icon { background: var(--success); }
.warning .stat-icon { background: var(--warning); }
.info .stat-icon { background: var(--info); }

.stat-content h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--dark);
}

.stat-content p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-trend {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--light);
  color: var(--text-light);
  max-width: fit-content;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.chart-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
}

.chart-controls select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
}

.chart-content {
  padding: 20px;
  height: 300px;
}

.chart-content canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Data Row */
.data-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.data-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.data-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
}

.btn-icon {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--light);
  color: var(--primary);
}

.data-content {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.runs-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.run-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: var(--transition);
}

.run-item:hover {
  border-color: var(--primary);
  background: var(--light);
}

.run-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.success { background: var(--success); }
.status-dot.error { background: var(--error); }
.status-dot.running { background: var(--warning); animation: pulse 1.5s infinite; }

.run-time {
  color: var(--text-light);
  font-size: 0.85rem;
}

.ad-performance {
  display: grid;
  gap: 12px;
}

.ad-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--light);
  border-radius: 6px;
}

.ad-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.ad-stats {
  display: flex;
  gap: 8px;
}

.ad-stat {
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Optimization Row */
.optimization-row {
  margin-bottom: 20px;
}

.optimization-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.optimization-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.optimization-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
}

.optimization-content {
  padding: 20px;
}

.schedule-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.schedule-card {
  background: var(--light);
  padding: 16px;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
}

.schedule-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.schedule-details {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.schedule-metrics {
  display: flex;
  gap: 12px;
}

.metric {
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text);
}

/* Control Panel */
.control-panel {
  margin-bottom: 20px;
}

.panel-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
}

.panel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.panel-status .status-dot {
  background: var(--success);
}

.panel-content {
  padding: 20px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.control-btn.primary {
  background: var(--primary);
  color: white;
}

.control-btn.primary:hover {
  background: var(--primary-hover);
}

.control-btn.warning {
  background: var(--warning);
  color: white;
}

.control-btn.warning:hover {
  background: #d97706;
}

.control-btn.info {
  background: var(--info);
  color: white;
}

.control-btn.info:hover {
  background: #2563eb;
}

.control-btn.secondary {
  background: var(--light);
  color: var(--text);
  border: 1px solid var(--border);
}

.control-btn.secondary:hover {
  background: var(--border);
}

.control-info {
  background: #f0f9ff;
  border-left: 4px solid var(--info);
  padding: 12px;
  border-radius: 4px;
  margin-top: 16px;
}

.control-info p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* Footer */
.dashboard-footer {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 30px;
}

.footer-content p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

/* 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(4px);
}

.modal-content {
  background: white;
  margin: 10% auto;
  padding: 0;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  color: var(--dark);
}

.close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.close:hover {
  color: var(--error);
}

.modal-body {
  padding: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.form-group small {
  display: block;
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.8rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--light);
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Floating Button */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 100;
}

.floating-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
  font-style: italic;
}

/* Utilities */
.info-badge {
  background: var(--light);
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 10px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .data-row {
    grid-template-columns: 1fr;
  }
  
  .control-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Security Warning Banner */
.security-warning-banner {
    background: #fffbe5;
    border: 1px solid #f59e0b;
    border-left-width: 4px;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.security-warning-banner .warning-icon {
    font-size: 1.5rem;
    color: #f59e0b;
    padding-top: 4px;
}

.security-warning-banner .warning-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 8px;
}

.security-warning-banner .warning-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #78350f;
}