:root {
  --background-color: #f5f6fa;
  --text-color: #333;
  --sidebar-bg-1: #2b5876;
  --sidebar-bg-2: #4e4376;
  --card-bg: #fff;
  --btn-bg: #4e4376;
  --btn-hover-bg: #2b5876;
  --highlight-color: #4e4376;
  --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
  --hover-transform: translateY(-5px);
}

/* Dark Mode Overrides */
body.dark-mode {
  --background-color: #1a1a2e;
  --text-color: #f5f6fa;
  --sidebar-bg-1: #0e0e1a;
  --sidebar-bg-2: #161625;
  --card-bg: #1f1f3a;
  --btn-bg: #4e4376;
  --btn-hover-bg: #2b5876;
  --highlight-color: #8c73cc;
  --card-shadow: 0 2px 5px rgba(255,255,255,0.1);
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  display: flex;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: linear-gradient(135deg, var(--sidebar-bg-1), var(--sidebar-bg-2));
  color: white;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar .profile {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar .profile img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid white;
  object-fit: cover;
  margin-bottom: 10px;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-top: 10px;
  color: white;
}

/* Sidebar Nav */
.sidebar nav {
  margin-top: 30px;
  width: 100%;
}

.sidebar nav a {
  display: block;
  padding: 12px;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.sidebar nav a:hover {
  background: rgba(255,255,255,0.2);
}

main {
  margin-left: 250px;
  padding: 40px;
  flex: 1;
}

.hero {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
  transition: background 0.4s ease;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  background: var(--btn-bg);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.btn:hover { background: var(--btn-hover-bg); }

section { margin-bottom: 50px; }
h2 {
  border-left: 5px solid var(--highlight-color);
  padding-left: 10px;
  font-family: 'Roboto Mono', monospace;
}

.cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  flex: 1 1 calc(33% - 20px);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, background 0.4s ease;
}

.card:hover { transform: var(--hover-transform); }

.card h3 a { color: var(--text-color); text-decoration: none; }

ul { list-style: none; padding: 0; }
ul li {
  background: var(--card-bg);
  margin-bottom: 10px;
  padding: 15px;
  border-radius: 5px;
  box-shadow: var(--card-shadow);
}
ul li a { color: var(--text-color); text-decoration: none; display: block; }

footer {
  background: #2b5876;
  color: white;
  text-align: center;
  padding: 10px 15px;
  line-height: 1.4;
  position: fixed;
  bottom: 0;
  left: 300px;
  right: 0;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
footer .socials a { 
  color: white; 
  margin: 0 8px; 
  display: inline-block;
}

/* Hamburger Menu */
.hamburger { 
  display: none; 
  font-size: 26px; 
  background: none; 
  border: none; 
  color: white; 
  cursor: pointer; 
}

/* RESPONSIVE */

/* Tablet */
@media (max-width: 1024px) {
  .card { flex: 1 1 calc(50% - 20px); }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  /* ردیف بالایی */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar .profile {
    display: flex;
    align-items: center;
  }

  .sidebar .profile img {
    width: 45px;
    height: 45px;
    margin-right: 8px;
    border: 2px solid white;
  }

  .profile-info {
    display: flex;
    flex-direction: column;
  }

  .profile-info h2 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.1;
  }

  .theme-toggle {
    font-size: 16px;
    margin-top: 2px;
    align-self: flex-start;
  }

  .hamburger { 
    display: block; 
    font-size: 26px;
  }

  .sidebar nav {
    display: none;
    flex-direction: column;
    background: linear-gradient(135deg, var(--sidebar-bg-1), var(--sidebar-bg-2));
    width: 100%;
    padding: 8px 0;
    margin-top: 8px;
    border-radius: 6px;
  }

  .sidebar nav.active { display: flex; }

  main { 
    margin-left: 0; 
    padding: 20px; 
  }

  .cards { 
    flex-direction: column; 
  }

  .card { 
    flex: 1 1 100%; 
  }

  footer {
    position: static;
    margin-top: 20px;
    border-radius: 0;
  }
}
