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

body {
  font-family: "Vazirmatn", sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e8e8e8;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 100vh;
  padding: 0;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.sidebar-header h4 {
  color: #64b5f6;
  font-weight: 600;
  margin: 0;
}

.sidebar .nav-link {
  color: #b0b0b0;
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar .nav-link:hover {
  background: rgba(100, 181, 246, 0.1);
  color: #64b5f6;
  transform: translateX(5px);
}

.sidebar .nav-link.active {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(100, 181, 246, 0.2) 100%
  );
  color: #64b5f6;
  border-left: 3px solid #64b5f6;
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
}

/* Main Content */
main {
  margin-right: 16.666667%;
  padding: 2rem;
  direction: rtl;
  text-align: right;
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-title {
  color: #64b5f6;
  font-weight: 700;
  margin: 0;
  font-size: 2.5rem;
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(100, 181, 246, 0.3);
}

.card-header {
  background: rgba(100, 181, 246, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px 15px 0 0 !important;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  color: #64b5f6;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Server/Database Cards */
.server-card,
.database-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
  overflow: visible !important;
}

.server-card:hover,
.database-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(100, 181, 246, 0.3);
}

.server-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 0.5rem;
}

.status-online {
  background: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-offline {
  background: #f44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.status-warning {
  background: #ff9800;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

/* Buttons */
.btn {
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #64b5f6 0%, #1976d2 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(100, 181, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e8e8e8;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
}

/* Form Controls */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e8e8e8;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #64b5f6;
  box-shadow: 0 0 0 0.2rem rgba(100, 181, 246, 0.25);
  color: white;
}

.form-control::placeholder {
  color: #b0b0b0;
}

.form-label {
  color: #64b5f6;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Modal */
.modal-content {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.modal-title {
  color: #64b5f6;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

/* Info Items */
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: #b0b0b0;
  font-weight: 500;
}

.info-value {
  color: #e8e8e8;
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.action-buttons .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    min-height: auto;
    margin-bottom: 1rem;
  }

  main {
    margin-right: 0;
    padding: 1rem;
  }

  .header-section {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .main-title {
    font-size: 2rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-section {
  animation: fadeIn 0.5s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 181, 246, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 181, 246, 0.7);
}

/* Light Theme */
.light-theme {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 50%, #a8caba 100%);
  color: #333;
}

.light-theme .sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .sidebar-header h4 {
  color: #1976d2;
}

.light-theme .sidebar .nav-link {
  color: #666;
}

.light-theme .sidebar .nav-link:hover {
  background: rgba(25, 118, 210, 0.1);
  color: #1976d2;
}

.light-theme .sidebar .nav-link.active {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(25, 118, 210, 0.2) 100%
  );
  color: #1976d2;
  border-left: 3px solid #1976d2;
}

.light-theme .header-section {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .main-title {
  color: #1976d2;
}

.light-theme .card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .server-card,
.light-theme .database-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .form-control,
.light-theme .form-select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #333;
}

.light-theme .form-control:focus,
.light-theme .form-select:focus {
  background: rgba(255, 255, 255, 1);
  border-color: #1976d2;
  color: #333;
}

.light-theme .form-label {
  color: #1976d2;
}

.light-theme .info-label {
  color: #666;
}

.light-theme .info-value {
  color: #333;
}

.light-theme .modal-content {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .modal-title {
  color: #1976d2;
}

.light-theme .dropdown-menu {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

.light-theme .dropdown-item {
  color: #333;
}

.light-theme .dropdown-item:hover {
  background: rgba(25, 118, 210, 0.1);
  color: #1976d2;
}

/* Dropdown Menu RTL */
.dropdown-menu {
  background: rgba(26, 26, 46, 0.95) !important;
  backdrop-filter: blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  right: 0 !important;
  left: auto !important;
  text-align: right !important;
  direction: rtl !important;
  position: absolute !important;
  z-index: 999999 !important;
  transform: none !important;
  margin-top: 0 !important;
  inset: auto !important;
}

.dropdown-item {
  color: #e8e8e8;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: rgba(100, 181, 246, 0.1);
  color: #64b5f6;
}

.dropdown-item.text-danger:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
}
