:root {
  --primary: #521C0D;
  --secondary: #D5451B;
  --accent: #FF9B45;
  --highlight: #7F55B1;
  --light-accent: #F4E7E1;
  --text-light: #f9f9f9;
  --text-dark: #333333;
  --bg-light: #F4E7E1;
  --bg-dark: #121212;
  --panel-width: 280px;
  --card-bg-light: #FFFFFF;
  --card-bg-dark: #1e1e1e;
  --border-light: rgba(0, 0, 0, 0.1);
  --border-dark: rgba(255, 255, 255, 0.1);
  --dark-mode-button-bg: #C5B3D6;
  --dark-mode-button-hover-bg: #9B7EBD;
  --header-height: 70px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Dark Mode Base */
.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

/* Header Controls */
.header-controls {
  width: 100%;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--accent);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

.dark-mode .header-controls {
  background-color: var(--card-bg-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark-mode-toggle {
  position: fixed;
  right: 20px;
  padding: 8px 16px;
  border-radius: 20px;
  background-color: var(--primary);
  border: none;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark-mode-toggle:hover {
  background-color: var(--secondary);
}

.dark-mode .dark-mode-toggle {
  background-color: var(--highlight);
}

.dark-mode .dark-mode-toggle:hover {
  background-color: var(--dark-mode-button-bg);
}

.kebab-menu {
  position: fixed;
  left: 20px;
  cursor: pointer;
  z-index: 1000;
  color: var(--text-light);
  font-size: 24px;
  background-color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.kebab-menu:hover {
  background-color: var(--secondary);
}

.dark-mode .kebab-menu {
  background-color: var(--highlight);
}

.dark-mode .kebab-menu:hover {
  background-color: var(--dark-mode-button-bg);
}

.home-logo {
  position: fixed;
  left: 80px;
  cursor: pointer;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(82, 28, 13, 0.1);
  transition: all 0.3s ease;
}

.home-logo:hover {
  background: rgba(82, 28, 13, 0.2);
}

.dark-mode .home-logo {
  background: rgba(127, 85, 177, 0.15);
}

.dark-mode .home-logo:hover {
  background: rgba(127, 85, 177, 0.25);
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
}

.side-panel.open~.home-logo {
  display: none;
}

.side-panel:not(.open)~.home-logo {
  display: flex;
}

.side-panel {
  position: fixed;
  top: 0;
  left: -280px;
  width: var(--panel-width);
  height: 100vh;
  background-color: var(--accent);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  left: 0;
}

.dark-mode .side-panel {
  background-color: var(--card-bg-dark);
  box-shadow: 2px 0 15px rgba(127, 85, 177, 0.15);
  border-right: 1px solid var(--highlight);
}

.side-panel-header {
  padding: 4.5px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .side-panel-header {
  border-bottom: 1px solid var(--border-dark);
}

.panel-logo {
  width: 80px;
  height: 80px;
  border-radius: 30%;
  transition: all 0.3s ease;
}

.dark-mode .panel-logo {
  filter: brightness(0.8) contrast(1.2);
}

.side-panel-header h3 {
  margin-left: 25%;
  color: var(--primary);
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.dark-mode .side-panel-header h3 {
  color: var(--highlight);
}

.side-panel-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.side-panel-content a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  transition: all 0.3s ease;
  gap: 12px;
}

.side-panel-content a:hover {
  background-color: rgba(88, 24, 69, 0.1);
}

.dark-mode .side-panel-content a {
  color: rgba(255, 255, 255, 0.85);
}

.dark-mode .side-panel-content a:hover {
  background-color: rgba(127, 85, 177, 0.15);
}

.side-panel-content a.active {
  background-color: var(--secondary);
  color: var(--text-light);
}

.dark-mode .side-panel-content a.active {
  background: linear-gradient(90deg, rgba(127, 85, 177, 0.3), transparent);
  border-left: 3px solid var(--highlight);
  color: white;
}

.side-panel-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  border-top: 1px solid var(--border-light);
  background-color: var(--accent);
}

.dark-mode .side-panel-footer {
  border-top: 1px solid var(--border-dark);
  background-color: var(--card-bg-dark);
}

.side-panel-footer a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  transition: all 0.3s ease;
  gap: 12px;
}

.dark-mode .side-panel-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.side-panel-footer a:hover {
  background-color: rgba(88, 24, 69, 0.1);
}

.dark-mode .side-panel-footer a:hover {
  background-color: rgba(127, 85, 177, 0.15);
}

.side-panel-footer a.active {
  background-color: var(--secondary);
  color: var(--text-light);
}

.dark-mode .side-panel-footer a.active {
  background: linear-gradient(90deg, rgba(127, 85, 177, 0.3), transparent);
  border-left: 3px solid var(--highlight);
  color: white;
}

/* Main Container */
.main-container {
  transition: margin-left 0.3s ease;
}

.main-container.panel-open {
  margin-left: var(--panel-width);
}

.developers-container {
  max-width: 1200px;
  margin: calc(var(--header-height) + 40px) auto 40px;
  padding: 40px;
  background-color: var(--card-bg-light);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
  transition: all 0.3s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dark-mode .developers-container {
  background-color: var(--card-bg-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: var(--text-light);
}

.developers-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}

.dark-mode .developers-header {
  border-bottom: 2px solid var(--highlight);
}

.developers-header h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--primary);
  transition: color 0.3s ease;
}

.dark-mode .developers-header h1 {
  color: var(--highlight);
}

.developers-header p {
  font-size: 1.2rem;
  color: var(--text-dark);
  line-height: 1.6;
  max-width: 44em;
  margin: 0 auto;
  text-align: center;
}

.dark-mode .developers-header p {
  color: var(--text-light);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.developer-card {
  perspective: 1000px;
  height: 400px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  box-sizing: border-box;
  border-radius: 16px;
}

.card-front {
  background-color: var(--card-bg-light);
  z-index: 2;
}

.dark-mode .card-front {
  background-color: rgba(127, 85, 177, 0.15);
}

.card-back {
  background-color: var(--card-bg-light);
  transform: rotateY(180deg);
  justify-content: center;
}

.dark-mode .card-back {
  background-color: rgba(127, 85, 177, 0.15);
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
  border: 5px solid var(--accent);
}

.dark-mode .profile-image {
  border-color: var(--highlight);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(82, 28, 13, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-mode .image-overlay {
  background: rgba(127, 85, 177, 0.3);
}

.profile-image:hover .image-overlay {
  opacity: 1;
}

.developer-card h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  transition: color 0.3s ease;
}

.dark-mode .developer-card h2 {
  color: var(--highlight);
}

.role {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 600;
}

.dark-mode .role {
  color: var(--light-accent);
}

.divider {
  width: 50px;
  height: 2px;
  background: var(--highlight);
  margin: 1rem 0;
}

.dark-mode .divider {
  background: var(--light-accent);
}

.expertise {
  font-size: 0.95rem;
  color: var(--text-dark);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.dark-mode .expertise {
  color: var(--text-light);
}

.card-back h3 {
  color: var(--secondary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.dark-mode .card-back h3 {
  color: var(--light-accent);
}

.card-back p {
  text-align: center;
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 0.95rem;
}

.dark-mode .card-back p {
  color: var(--text-light);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.social-links a {
  color: var(--highlight);
  font-size: 1.5rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.dark-mode .social-links a {
  color: var(--light-accent);
}

.social-links a:hover {
  transform: scale(1.2);
  color: var(--secondary);
}

.dark-mode .social-links a:hover {
  color: var(--accent);
}

.tech-stack-section {
  margin: 4rem 0;
  text-align: center;
}

.tech-stack-section h2 {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 2rem;
  transition: color 0.3s ease;
}

.dark-mode .tech-stack-section h2 {
  color: var(--highlight);
}

.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 155, 69, 0.1);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .tech-item {
  background: rgba(127, 85, 177, 0.15);
  border: 1px solid var(--border-dark);
}

.tech-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.dark-mode .tech-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tech-item i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--highlight);
}

.dark-mode .tech-item i {
  color: var(--light-accent);
}

.tech-item span {
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: color 0.3s ease;
}

.dark-mode .tech-item span {
  color: var(--text-light);
}

.project-info {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 2rem;
  background: rgba(255, 155, 69, 0.1);
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.dark-mode .project-info {
  background: rgba(127, 85, 177, 0.15);
  border: 1px solid var(--border-dark);
}

.project-info h2 {
  color: var(--primary);
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.dark-mode .project-info h2 {
  color: var(--highlight);
}

.project-info p {
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: justify;
  max-width: 44em;
  margin-left: auto;
  margin-right: auto;
}

.dark-mode .project-info p {
  color: var(--text-light);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--primary);
  color: var(--text-light);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s ease, background 0.3s ease;
}

.dark-mode .github-link {
  background: var(--highlight);
}

.github-link:hover {
  transform: translateY(-3px);
  background: var(--secondary);
}

.dark-mode .github-link:hover {
  background: var(--light-accent);
  color: var(--text-dark);
}

@media (max-width: 992px) {
  .header-controls {
    flex-wrap: wrap;
    padding-bottom: 70px;
  }

  .developers-container {
    margin-top: 150px;
    width: 98vw;
    max-width: 98vw;
    padding: 25px 2vw;
  }

  .dark-mode-toggle {
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .kebab-menu {
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }

  .home-logo {
    top: 15px;
    left: 60px;
  }
}

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

  .developers-header h1 {
    font-size: 1.5rem;
  }

  .developer-card {
    height: 380px;
  }

  .developers-container {
    margin-top: 120px;
    width: 100vw;
    max-width: 100vw;
    padding: 12px 2vw;
    border-radius: 0;
  }

  .developers-header p {
    font-size: 1rem;
    margin-left: 10px;
    margin-right: 10px;
  }

  .project-info p {
    margin-left: 10px;
    margin-right: 10px;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .header-controls {
    flex-direction: column;
    padding: 0.5px;
    height: auto;
    min-height: var(--header-height);
    gap: 10px;
  }

  .dark-mode-toggle {
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 16px;
  }

  .kebab-menu {
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .home-logo {
    top: 10px;
    left: 60px;
    width: 32px;
    height: 32px;
  }

  .logo-img {
    width: 32px;
    height: 32px;
  }

  .side-panel {
    width: 240px;
    left: -240px;
  }

  .side-panel.open {
    left: 0;
  }

  .side-panel-header {
    padding: 15px;
  }

  .panel-logo {
    width: 60px;
    height: 60px;
  }

  .side-panel-header h3 {
    font-size: 1rem;
    margin-left: 20%;
    margin-top: 1px;
  }

  .side-panel-content a {
    padding: 10px 12px;
    font-size: 0.95rem;
    gap: 8px;
  }

  .developers-container {
    margin: calc(var(--header-height) + 20px) auto 20px;
    padding: 15px 3vw;
    border-radius: 8px;
    width: 90vw;
  }

  .developers-header h1 {
    font-size: 1.4rem;
    padding-bottom: 8px;
    margin-bottom: 15px;
  }

  .developers-header p {
    font-size: 0.95rem;
    margin: 0 5px;
  }

  .developer-card {
    height: 360px;
  }

  .profile-image {
    width: 120px;
    height: 120px;
  }

  .developer-card h2 {
    font-size: 1.3rem;
  }

  .role {
    font-size: 1rem;
  }

  .expertise {
    font-size: 0.9rem;
  }

  .card-back p {
    font-size: 0.9rem;
  }

  .tech-stack-section h2 {
    font-size: 1.4rem;
  }

  .tech-item i {
    font-size: 2rem;
  }

  .tech-item span {
    font-size: 0.9rem;
  }

  .project-info {
    padding: 1.5rem;
  }

  .project-info h2 {
    font-size: 1.4rem;
  }

  .project-info p {
    font-size: 0.95rem;
    margin: 0 5px;
  }

  .github-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
}