/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

body {
  background-color: #f9f9f9;
  color: #333;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  gap: 0;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  height: 100vh;
  background: linear-gradient(to bottom, #1c1e21, #4285f4);
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .new-chat p,
.sidebar.collapsed .recent-title,
.sidebar.collapsed .recent-entry p,
.sidebar.collapsed .bottom-item p {
  display: none;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  padding: 5px;
}

.logo-text {
  font-size: 22px;
  font-weight: 600;
}

.menu {
  width: 24px;
  cursor: pointer;
  margin-left: auto;
  filter: invert(1);
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 12px 15px;
  border-radius: 50px;
  margin: 15px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.new-chat:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.new-chat img {
  width: 20px;
  filter: invert(1);
}

.recent-title {
  font-size: 14px;
  margin: 20px 0 15px;
  opacity: 0.8;
  font-weight: 500;
}

.recent-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-entry:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.recent-entry img {
  width: 18px;
  filter: invert(1);
}

.bottom {
  margin-top: auto;
}

.bottom-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bottom-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.bottom-item img {
  width: 20px;
  filter: invert(1);
}

/* Main Content Styles */
.main {
  flex: 1;
  min-height: 100vh;
  margin-left: 280px;
  position: relative;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav p {
  font-size: 20px;
  font-weight: 600;
  color: #1a73e8;
}

.nav img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.nav img:hover {
  transform: scale(1.1);
}

.main-container {
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

#chatArea {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 100px;
}

.greet {
  margin: 20px 0 30px;
  text-align: center;
}

.greet p {
  font-size: 28px;
  font-weight: 400;
  color: #555;
  line-height: 1.4;
}

.greet span {
  background: linear-gradient(45deg, #1a73e8, #4285f4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
}

.card {
  width: 200px;
  height: 150px;
  background-color: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #1a73e8, #4285f4);
}

.card p {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
}

.card img {
  width: 35px;
  height: 35px;
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: #f0f4f9;
  padding: 8px;
  border-radius: 50%;
}

/* Chat Conversation */
#conversation {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 15px;
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f0f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar img {
  width: 24px;
  height: 24px;
}

.message-content {
  background-color: white;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.message.user .message-content {
  background-color: #1a73e8;
  color: white;
}

.message-text {
  font-size: 15px;
  line-height: 1.5;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 10px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #1a73e8;
  border-radius: 50%;
  animation: typingAnimation 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Search Box */
.main-bottom {
  position: fixed;
  bottom: 0;
  left: 280px;
  right: 0;
  padding: 20px;
  background-color: #f9f9f9;
  z-index: 10;
  transition: all 0.3s ease;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 50px;
  padding: 5px 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  box-shadow: 0 5px 20px rgba(26, 115, 232, 0.2);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 15px 0;
  font-size: 16px;
}

.search-box div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-box img {
  width: 24px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-box img:hover {
  transform: scale(1.1);
}

.bottom-info {
  font-size: 12px;
  color: #777;
  text-align: center;
  margin-top: 10px;
}

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

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #777;
}

.modal h2 {
  margin-bottom: 20px;
  color: #1a73e8;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
  outline: none;
}

.submit-btn {
  background: linear-gradient(45deg, #1a73e8, #4285f4);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  width: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(26, 115, 232, 0.3);
}

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

@keyframes typingAnimation {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark Mode */
body.dark-mode {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

body.dark-mode .main {
  background-color: #1e1e1e;
}

body.dark-mode .nav {
  background-color: #2c2c2c;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .nav p {
  color: #4285f4;
}

body.dark-mode .card {
  background-color: #2c2c2c;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .card p {
  color: #f0f0f0;
}

body.dark-mode .card img {
  background-color: #3c3c3c;
}

body.dark-mode .message-content {
  background-color: #2c2c2c;
  color: #f0f0f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .message.user .message-content {
  background-color: #1a73e8;
  color: white;
}

body.dark-mode .search-box {
  background-color: #2c2c2c;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .search-box input {
  background-color: transparent;
  color: #f0f0f0;
}

body.dark-mode .main-bottom {
  background-color: #1e1e1e;
}

body.dark-mode .bottom-info {
  color: #aaa;
}

body.dark-mode .modal-content {
  background-color: #2c2c2c;
  color: #f0f0f0;
}

body.dark-mode .form-group label {
  color: #ddd;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background-color: #3c3c3c;
  border-color: #444;
  color: #f0f0f0;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .sidebar {
    width: 250px;
  }

  .main {
    margin-left: 250px;
  }

  .main-bottom {
    left: 250px;
  }

  .card {
    width: 180px;
    height: 140px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
  }

  .sidebar.active {
    width: 250px;
    padding: 20px;
  }

  .main {
    margin-left: 0;
  }

  .main-bottom {
    left: 0;
  }

  .cards {
    flex-wrap: wrap;
    justify-content: center;
  }

  .card {
    width: calc(50% - 20px);
  }

  .message {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 15px;
  }

  .greet p {
    font-size: 22px;
  }

  .cards {
    gap: 15px;
  }

  .card {
    width: 100%;
    height: auto;
    min-height: 120px;
  }

  .search-box {
    padding: 5px 15px;
  }

  .search-box input {
    padding: 12px 0;
    font-size: 14px;
  }

  .message {
    max-width: 100%;
  }
}
