/* Database Management Styles - RAdmin Style */

/* RAdmin Tabs Styles */
.radmin-tabs {
  display: flex;
  background: #2d2d2d;
  border-radius: 6px;
  border: 1px solid #404040;
  margin-bottom: 20px;
  overflow: hidden;
}

.radmin-tab {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: #cccccc;
  background: #2d2d2d;
  border-right: 1px solid #404040;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}

.radmin-tab:last-child {
  border-right: none;
}

.radmin-tab:hover {
  background: #404040;
  color: #20a53a;
}

.radmin-tab.active {
  background: #20a53a;
  color: #ffffff;
}

.radmin-tab i {
  margin-right: 8px;
  font-size: 1rem;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #404040;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

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

.stat-card {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.stat-icon.databases {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-icon.databases::before { content: "🗄️"; }

.stat-icon.backups {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.stat-icon.backups::before { content: "💾"; }

.stat-icon.storage {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.stat-icon.storage::before { content: "💿"; }

.stat-content h3 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
}

.stat-content p {
  margin: 0;
  color: #cccccc;
  font-size: 0.9rem;
}

/* Section Headers */
.section-header {
  margin: 2rem 0 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 0;
}

/* RAdmin Toggle Buttons */
.radmin-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #404040;
  background: #2d2d2d;
  color: #cccccc;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-left: 4px;
}

.radmin-toggle-btn:first-child {
  margin-left: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.radmin-toggle-btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.radmin-toggle-btn:hover {
  background: #404040;
  color: #20a53a;
  border-color: #20a53a;
}

.radmin-toggle-btn.active {
  background: #20a53a;
  color: #ffffff;
  border-color: #20a53a;
}

.radmin-toggle-btn i {
  font-size: 1rem;
}

/* Database Cards Grid */
.databases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.database-card {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
  padding: 1.5rem;
  background: #404040;
  border-bottom: 1px solid #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.database-info h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

.database-engine {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.database-status {
  font-size: 1.2rem;
}

.database-status.active {
  color: #28a745;
}

.database-status.error {
  color: #dc3545;
}

.card-body {
  padding: 1.5rem;
}

.database-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.stat .label {
  color: #999;
  font-size: 0.9rem;
}

.stat .value {
  font-weight: 500;
  color: #cccccc;
}

.card-actions {
  padding: 1rem 1.5rem;
  background: #404040;
  border-top: 1px solid #555;
  display: flex;
  gap: 0.5rem;
}

.btn-backup, .btn-manage {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-backup {
  background: #28a745;
  color: white;
}

.btn-backup:hover {
  background: #218838;
}

.btn-backup:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.btn-manage {
  background: #6c757d;
  color: white;
}

.btn-manage:hover {
  background: #5a6268;
}

.btn-icon {
  font-size: 1rem;
}

/* Backups Table */
.backups-table {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  overflow: hidden;
}

.backups-table .table {
  margin: 0;
}

.backups-table th {
  background: #404040;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 2px solid #555;
}

.btn-download, .btn-delete {
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 0.5rem;
  text-decoration: none;
  display: inline-block;
}

.btn-download {
  background: #007bff;
  color: white;
}

.btn-download:hover {
  background: #0056b3;
  color: white;
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c82333;
}

/* Notifications */
#notification-area {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1050;
  max-width: 400px;
}

.notification {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left-color: #28a745;
}

.notification.error {
  border-left-color: #dc3545;
}

.notification.info {
  border-left-color: #17a2b8;
}

.notification-icon {
  font-weight: bold;
  font-size: 1.1rem;
}

.notification.success .notification-icon {
  color: #28a745;
}

.notification.error .notification-icon {
  color: #dc3545;
}

.notification.info .notification-icon {
  color: #17a2b8;
}

.notification-message {
  flex: 1;
  font-size: 0.9rem;
  color: #cccccc;
}

.notification-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 20px;
  height: 20px;
}

.notification-close:hover {
  color: #cccccc;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .databases-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  #notification-area {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}