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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e1e1e, #0f0f0f);
  color: #e0e0e0;
  display: flex;
  height: 100vh;
  transition: background 0.3s ease;
}

#sidebar {
  width: 250px;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

#sidebarArrow {
  display: none;
}

#sidebar nav {
  opacity: 1;
}

#logoutButton {
  opacity: 1;
}

#sidebar:hover #sidebarArrow {
  opacity: 0;
}

#sidebar:hover nav {
  opacity: 1;
}

#sidebar h2 {
  margin-bottom: 30px;
}

#sidebar nav a {
  color: #ccc;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
  font-size: 18px;
  padding: 10px 15px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

#sidebar nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: skewX(-45deg);
  transition: left 0.3s ease;
}

#sidebar nav a:hover::before {
  left: 100%;
}

#sidebar nav a.active,
#sidebar nav a:hover {
  color: #ffffff;
  font-weight: bold;
  background-color: #333333;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

#sidebar nav a:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

#logoutButton {
  background-color: #ff4c4c;
  border: none;
  padding: 10px;
  color: white;
  cursor: pointer;
  margin-top: auto;
  border-radius: 8px;
  font-size: 16px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 76, 76, 0.5);
  opacity: 1;
}

#sidebar:hover #logoutButton {
  opacity: 1;
}

#logoutButton:hover {
  background-color: #e63939;
  transform: scale(1.05);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

#logoutButton:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(255, 76, 76, 0.7);
}

#main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.7);
  border: 1px solid #333333;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: skewX(-45deg);
  transition: left 0.3s ease;
}

.card:hover::before {
  left: 100%;
}

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

.card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.card h3 {
  margin-bottom: 15px;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.card ul li {
  font-size: 14px;
  color: #cccccc;
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card ul li strong {
  color: #ffffff;
}

.card ul li span {
  font-size: 12px;
  color: #aaaaaa;
}

.card ul li:hover {
  background: rgba(255, 255, 255, 0.1);
}

.card i {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

.card:hover i {
  transform: scale(1.1);
}

.card button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #0070f3, #0059c1);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 112, 243, 0.5);
}

.card button:hover {
  background-color: #0059c1;
  transform: scale(1.05);
}

.card button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(0, 112, 243, 0.7);
}

.bucket-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.bucket {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  border: 1px solid #333333;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bucket:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.9);
}

.bucket h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.bucket ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bucket ul li {
  font-size: 14px;
  color: #cccccc;
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.bucket ul li strong {
  color: #ffffff;
}

.bucket ul li:hover {
  background: rgba(255, 255, 255, 0.1);
}

.statistics {
  margin-top: 40px;
  padding: 20px;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.statistics h2 {
  margin-bottom: 20px;
  text-align: center;
  font-size: 24px;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#swearStatsChart {
  max-width: 100%;
  height: 400px;
}

.chart-container {
  background: rgba(30, 30, 30, 0.6);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  margin: 30px auto;
  max-width: 1000px;
}

.chart-container:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9);
}

canvas {
  max-height: 400px;
}

.stats-description {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 20px;
  text-align: center;
}

.chart-container {
  position: relative;
  padding: 20px;
  background: linear-gradient(135deg, #2e2e2e, #1e1e1e);
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.8);
}

.chart-legend {
  margin-top: 10px;
  font-size: 14px;
  color: #bbbbbb;
  text-align: center;
}

.chart-legend span {
  display: inline-block;
  margin-right: 10px;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #1e1e1e, #0f0f0f);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border-radius: 5px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #333333, #222222);
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  #sidebar {
    display: none;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 15px;
    box-shadow: none;
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1e1e1e, #0f0f0f);
  }

  #sidebar nav {
    opacity: 1;
    display: flex;
    flex-direction: row;
    gap: 15px;
  }

  #sidebar nav a {
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  #sidebar nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  #logoutButton {
    margin-top: 0;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px; 
  }

  #main {
    padding: 20px;
    margin-top: 10px;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .card {
    flex: none;
    padding: 20px;
    border-radius: 10px;
  }

  .card h3 {
    font-size: 18px;
  }

  .card i {
    font-size: 22px;
  }

  .card button {
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 6px;
  }

  .statistics {
    padding: 15px;
  }

  .statistics h2 {
    font-size: 20px;
  }

  .chart-container {
    padding: 10px;
    margin-bottom: 20px;
  }
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.action-bar button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #28a745, #218838);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.5);
  transition: background 0.3s ease, transform 0.2s ease;
}

.action-bar button:hover {
  background: #218838;
  transform: scale(1.05);
}

.action-bar button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(40, 167, 69, 0.7);
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 10px;
  width: 300px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
}

.modal-content input {
  padding: 10px;
  font-size: 16px;
  background: #2e2e2e;
  border: 1px solid #444;
  border-radius: 6px;
  color: white;
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  background: linear-gradient(135deg, #0070f3, #0059c1);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.modal-actions button:hover {
  background: #0059c1;
}

.collapsible {
  cursor: pointer;
  color: #00bcd4;
  text-decoration: underline;
}

.collapsible:hover {
  color: #0097a7;
}

.uploadForm button, #uploadForm button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #28a745, #218838);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.5);
}

.uploadForm button:hover, #uploadForm button:hover {
  background: #218838;
  transform: scale(1.05);
}

.uploadForm button:active, #uploadForm button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(40, 167, 69, 0.7);
}

.uploadForm input[type="file"], #uploadForm input[type="file"] {
  margin-right: 10px;
  font-size: 14px;
  color: #cccccc;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.uploadForm input[type="file"]:hover, #uploadForm input[type="file"]:hover {
  background: #333333;
  color: #ffffff;
}
