body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #222;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
  margin: 0;
}

body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .header {
  background: #000;
}

body.dark-mode .project-box {
  background: #2a2a2a;
  border-color: #444;
}

body.dark-mode .project-box:hover {
  border-color: #0078ff;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

body.dark-mode .skill-bar {
  background: #2a2a2a;
}

body.dark-mode .note-content {
  background: #2a2a2a;
  border-color: #444;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: #0078ff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: #0078ff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: scale(1.1);
}

.header {
  background: #111;
  color: white;
  padding: 15px 0;
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}

.nav a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-size: 16px;
}

.nav a:hover {
  text-decoration: underline;
}

.hero {
  max-width: 1100px;
  margin: 50px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 0 15px;
}

.hero img {
  width: 280px;
  border-radius: 10px;
}

.accent {
  color: #0078ff;
  font-weight: bold;
}

.about, .projects, .contact, .skills, .media-section, .slider-section, .layout-note {
  max-width: 1100px;
  margin: 50px auto;
  padding: 0 15px;
}

.about p {
  max-width: 800px;
}

.skills-container {
  margin-top: 30px;
}

.skill-item {
  margin-bottom: 25px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: bold;
}

.skill-bar {
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, #0078ff, #00a2ff);
  width: 0;
  transition: width 1.5s ease-in-out;
  border-radius: 10px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-box {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: 0.2s;
  background: #fafafa;
  cursor: pointer;
}

.project-box:hover {
  transform: translateY(-4px);
  border-color: #0078ff;
  box-shadow: 0 4px 12px rgba(0,120,255,0.2);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.media-item {
  text-align: center;
}

.media-item h4 {
  margin-bottom: 15px;
  color: #0078ff;
}

#myCanvas {
  border: 2px solid #ddd;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
}

.slider-container {
  position: relative;
  max-width: 600px;
  margin: 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-images {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.slider-img {
  width: 100%;
  display: none;
  border-radius: 10px;
}

.slider-img.active {
  display: block;
}

.slider-btn {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 15px;
  cursor: pointer;
  font-size: 24px;
  border-radius: 5px;
  z-index: 10;
  transition: background 0.3s;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.slider-btn.prev {
  left: 10px;
}

.slider-btn.next {
  right: 10px;
}

.slider-dots {
  text-align: center;
  margin-top: 15px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #ddd;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: #0078ff;
}

.note-content {
  background: #f9f9f9;
  padding: 20px;
  border-left: 4px solid #0078ff;
  border-radius: 5px;
  margin-top: 20px;
}

.note-content p {
  margin: 10px 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  gap: 15px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 5px;
}

.contact-form button {
  width: 120px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #0078ff;
  color: white;
  cursor: pointer;
  font-size: 16px;
}

.contact-form button:hover {
  background: #005fcc;
}

.footer {
  background: #111;
  padding: 20px;
  text-align: center;
}

.footer a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 780px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero img {
    width: 200px;
  }

  .nav a {
    margin-left: 10px;
    font-size: 14px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}
