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

body {
  font-family: "Roboto", sans-serif;
  display: flex;
}

/* Container holding both sidebar and main content */
.dashboard-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar {
  margin: 10px;
  width: 250px;
  background: linear-gradient(135deg, #4c6ef5, #6a82fb);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  position: fixed; /* Keep sidebar fixed */
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1;
}

.add-btn button {
  background: white;
  color: #4c6ef5;
  border: none;
  margin-top: 10px;
  margin-bottom: 25px;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}

.add-btn button:hover {
  background: #fff0;
  color: #fff;
  border: 1px solid white;
}

/* Sidebar logo and menu */
.logo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.menu {
  list-style: none;
  padding: 0;
  width: 100%;
}

.menu li {
  padding: 12px 20px;
  margin: 5px 0;
  cursor: pointer;
  color: #fff;
  background: transparent;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.menu li:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
  color: #eee;
}

.menu a {
  text-decoration: none;
  color: inherit; 
  display: flex; 
  align-items: center;
}

.menu i {
  margin-right: 8px; 
}


/* Invite Section */
.invite-section {
  margin-top: auto;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 0;
}

.invite-section button {
  background: white;
  color: #4c6ef5;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}

.invite-section button:hover {
  background: #fff0;
  color: #fff;
  border: 1px solid white;
}

/* Main Content */
.main-content {
  margin-top: 10px;
  margin-left: 250px;
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.header h1 {
  margin-left: 20px;
  color: #4c6ef5;
}

.header input {
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  width: 300px;
  font-size: 14px;
}

.search-container {
  display: flex;
  align-items: center;
  position: relative;
}

.search-container input {
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  width: 250px;
  font-size: 14px;
  margin-right: 10px;
}

.search-btn {
  background-color: #4c6ef5;
  border: none;
  padding: 8px 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

.search-btn i {
  font-size: 18px;
}

.search-btn:hover {
  background-color: #6a82fb;
}

/* Profile Container */
.profile-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.profile-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.profile-name {
  font-weight: bold;
  margin: 0 10px 0 0;
  color: #313135b8;
}

/* Dropdown Menu */
.context-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 10px 0;
  margin: 0;
  width: 150px;
  z-index: 1000;
}

.context-menu li {
  padding: 10px 20px;
  cursor: pointer;
}

.context-menu li:hover {
  background-color: #f0f0f0;
}

.context-menu a {
  text-decoration: none;
  color: #333;
}

.context-menu a:hover {
  color: #4c6ef5;
}

.profile-container:hover .profile-img {
  border: 2px solid #4c6ef5;
}

/* Stats Section */
.stats {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.stat-box {
  flex: 1;
  background: #eef5ff;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.stat-box:hover {
  transform: translateY(-5px);
}

.stat-box span {
  display: block;
  font-size: 28px;
  font-weight: bold;
  margin-top: 10px;
}

/* Charts Section */
.charts {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}

.chart {
  max-width: 45%;
  margin: 0 auto;
}

.bar-chart,
.pie-chart {
  height: 280px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
}

.notmess {
  display: flex;
  width: 100%;
  margin-top: 30px;
  justify-content: space-around;
}

.notices-container,
.messages-container {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 5px;
  background-color: #eef5ff;
}

/* Notices Section Styling */
.notices {
  width: 45%;
  border: 1px solid #ddd;
  background-color: #eef5ff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.notices h1 {
  margin-bottom: 15px;
  color: #2c3e50;
  text-align: center;
}

.notice {
  background-color: #ffffff;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 6px;
  border-left: 6px solid #e74c3c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.notice:hover {
  transform: translateY(-5px);
}

.notice h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #34495e;
}

.notice p {
  margin: 0 0 5px;
  font-size: 16px;
  color: #7f8c8d;
}

.notice .timestamp {
  font-size: 14px;
  color: #bdc3c7;
  display: block;
  margin-top: 5px;
  text-align: right;
}

/* Messages Section Styling */
.messages {
  width: 45%;
  background-color: #eef5ff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.messages h1 {
  margin-bottom: 15px;
  color: #2c3e50;
  text-align: center;
}

.message {
  display: flex;
  align-items: flex-start;
  background-color: #ffffff;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 6px;
  border-left: 6px solid #3498db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.message:hover {
  transform: translateY(-5px);
}

.message .user-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
}

.message-content {
  flex-grow: 1;
}

.message-content h4 {
  margin: 0;
  font-size: 18px;
  color: #34495e;
}

.message-content p {
  margin: 5px 0;
  font-size: 16px;
  color: #7f8c8d;
}

.message-content .timestamp {
  font-size: 14px;
  color: #bdc3c7;
  text-align: right;
}

.show-all-btn {
  display: block;
  margin: 10px auto;
  padding: 10px 20px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.show-all-btn:hover {
  background-color: #0056b3;
}

/* Modal Container */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Content */
.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
}

/* Modal Body */
.modal-body {
  margin-top: 20px;
  max-height: 400px;
  overflow-y: auto;
}

/* Database Section */
.database {
  background: #fafafa;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.database .btn {
  width: 100%;
  color: rgb(0, 0, 0);
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
}

.database .btn h1 {
  width: auto;
  display: flex;
  float: left;
  color: #4c6ef5;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background: #f5f5f5;
  color: #555;
}

table tbody tr:hover {
  background: #f9f9f9;
}

/* Button Styling */
.add-student-btn {
  display: flex;
  float: right;
  background-color: #4c6ef5;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
  margin-bottom: 20px;
}

.add-student-btn:hover {
  background-color: #6a82fb;
}

.remove-selected-btn {
  display: flex;
  float: right;
  margin-right: 10px;
  background-color: #f44336;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 20px;
}

.remove-selected-btn:hover {
  background-color: #d32f2f;
}

/* Form Styling */
.add-student-form {
  display: none;
  background-color: #fafafa;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.add-student-form input,
.add-student-form select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.add-student-form button {
  background-color: #4c6ef5;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.add-student-form button:hover {
  background: #6a82fb;
}

.add-student-form button[type="button"] {
  background: #f44336;
  color: white;
  margin-left: 10px;
}

.add-student-form button[type="button"]:hover {
  background: #d32f2f;
}

@media screen and (max-width: 768px) {
  /* Global Styles */
  body {
    flex-direction: column;
  }

  .dashboard-container {
    flex-direction: column;
  }

  /* Sidebar */
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    margin: 0 0 10px;
    padding: 15px;
  }

  .sidebar .menu li {
    justify-content: center;
    gap: 5px;
  }

  /* Main Content */
  .main-content {
    margin: 0;
    padding: 15px;
    border-radius: 0;
    box-shadow: none;
  }

  /* Header */
  .header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header input {
    width: 100%;
  }

  /* Stats Section */
  .stats {
    flex-wrap: wrap;
    gap: 10px;
  }

  .stat-box {
    flex: 1 1 100%;
  }

  /* Charts Section */
  .charts {
    flex-wrap: wrap;
  }

  .chart {
    max-width: 100%;
  }

  /* Notices and Messages Section */
  .notmess {
    flex-direction: column;
    gap: 20px;
  }

  .notices,
  .messages {
    width: 100%;
  }

  /* Database */
  .database {
    overflow-x: auto;
  }

  table th,
  table td {
    white-space: nowrap;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    max-height: 80%;
  }

  /* Form Adjustments */
  .add-student-form input,
  .add-student-form select,
  .add-student-form button {
    width: 100%;
  }

  /* Buttons */
  .add-student-btn,
  .remove-selected-btn {
    width: 100%;
    margin: 10px 0;
  }
}
