@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap");

:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --background-color: #ecf0f1;
  --text-color: #34495e;
  --error-color: #e74c3c;
  --widget-bg: #f9f9f9;
  --progress-bg: #e0e0e0;
  --border-color: #bdc3c7;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

h1 i {
  margin-right: 10px;
  font-size: 1.8rem;
}

.header-actions {
  display: flex;
  align-items: center;
}

#notificationCenter {
  position: relative;
  margin-right: 1rem;
  cursor: pointer;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--error-color);
  color: white;
  border-radius: 50%;
  padding: 2px 5px;
  font-size: 0.7rem;
}

nav {
  background-color: #2980b9;
  padding: 0.5rem;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  margin: 0 0.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
}

nav ul li a i {
  margin-right: 5px;
}

nav ul li a:hover,
nav ul li a.active {
  background-color: #3498db;
  transform: translateY(-2px);
}

main {
  flex-grow: 1;
  padding: 2rem;
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.widget {
  background-color: var(--widget-bg);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.progress-bar {
  background-color: var(--progress-bg);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress {
  height: 100%;
  width: 0;
  background-color: var(--primary-color);
  transition: width 0.5s ease-out;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: left;
}

th {
  background-color: var(--widget-bg);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.hidden-section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.active-section {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem;
  border-radius: 4px;
  font-weight: bold;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.message.show {
  opacity: 1;
  transform: translateY(0);
}

.error {
  background-color: var(--error-color);
  color: rgb(255, 255, 255);
}

.success {
  background-color: var(--secondary-color);
  color: white;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-bar {
  width: 200px;
  height: 5px;
  background-color: var(--progress-bg);
  border-radius: 2.5px;
  overflow: hidden;
  margin-top: 1rem;
}

.loading-progress {
  width: 0;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease-out;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
}

.theme-switch {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.theme-switch-label:before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background-color: white;
  transition: transform 0.3s;
}

.theme-switch:checked + .theme-switch-label {
  background-color: var(--primary-color);
}

.theme-switch:checked + .theme-switch-label:before {
  transform: translateX(30px);
}

.theme-switch-label .fa-sun {
  position: absolute;
  left: 6px;
  top: 6px;
  color: #f39c12;
}

.theme-switch-label .fa-moon {
  position: absolute;
  right: 6px;
  top: 6px;
  color: #f1c40f;
}

/* Dark theme */
body.dark-theme {
  --background-color: #2c3e50;
  --text-color: #ecf0f1;
  --widget-bg: #34495e;
  --progress-bg: #2c3e50;
  --border-color: #4a6278;
}

body.dark-theme .container {
  background-color: #2c3e50;
}

body.dark-theme header {
  background-color: #2c3e50;
}

body.dark-theme nav {
  background-color: #34495e;
}

body.dark-theme main {
  background-color: #2c3e50;
}

body.dark-theme .widget {
  background-color: #34495e;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="date"],
body.dark-theme select {
  background-color: #2c3e50;
  color: #ecf0f1;
  border-color: #4a6278;
}

body.dark-theme .loading-content {
  background-color: #34495e;
  color: #ecf0f1;
}

body.dark-theme .theme-switch-label {
  background-color: #34495e;
}

body.dark-theme .theme-switch-label:before {
  background-color: #2c3e50;
}

#urlManager {
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--widget-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#urlManager:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.link-item {
  margin-bottom: 1rem;
}

.link-item span {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

#logEntries {
  max-height: 300px;
  overflow-y: auto;
}

.log-entry {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.info {
  background-color: rgba(52, 152, 219, 0.1);
}

.log-entry.warning {
  background-color: rgba(241, 196, 15, 0.1);
}

.log-entry.error {
  background-color: rgba(255, 25, 0, 0.1);
}

.search-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#userSearch {
  flex-grow: 1;
  margin-right: 1rem;
}

#pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

#pagination button {
  margin: 0 0.5rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.quick-actions-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 1rem;
}

.quick-actions-grid button i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.quick-actions-grid button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-5px);
}

#recentActivities {
  margin-top: 2rem;
}

#activityList {
  list-style-type: none;
  padding: 0;
}

#activityList li {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

#activityList li:hover {
  background-color: var(--widget-bg);
}

#activityList li:last-child {
  border-bottom: none;
}

.performance-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.chart-container {
  background-color: var(--widget-bg);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-panel {
  position: fixed;
  top: 60px;
  right: -300px;
  width: 300px;
  height: calc(100vh - 60px);
  background-color: var(--widget-bg);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  z-index: 1000;
}

.notification-panel.active {
  right: 0;
}

.notification-panel h3 {
  padding: 1rem;
  margin: 0;
  background-color: var(--primary-color);
  color: white;
}

#closeNotifications {
  float: right;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
}

#closeNotifications:hover {
  color: var(--error-color);
}

#notificationList {
  list-style-type: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  height: calc(100% - 50px);
}

#notificationList li {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

#notificationList li:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  nav ul {
    flex-direction: column;
  }

  nav ul li {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }

  .performance-charts {
    grid-template-columns: 1fr;
  }

  .notification-panel {
    width: 100%;
    right: -100%;
  }
}
