/* CSS giữ nguyên + thêm 1 số style mới */
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  background: #f4f4f4;
  color: #333;
  transition: background 0.3s, color 0.3s;
}
body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}
header {
  background: linear-gradient(to right, #007acc, #005f99);
  color: white;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  animation: fadeSlideDown 1s ease-in-out;
  
}
header img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  margin-bottom: 10px;
  animation: zoomIn 1s ease-in-out;
  transition: transform 0.3s;
}
header img:hover {
  transform: scale(1.1);
}
#toggle-theme {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  color: #333;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
#toggle-theme:hover {
  transform: scale(1.05);
  background: #eee;
}
body.dark-mode #toggle-theme {
  background: #333;
  color: white;
}
nav {
  background: #005f99;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  animation: slideInLeft 1s ease-in-out;
}
nav a {
  color: white;
  padding: 15px 20px;
  display: inline-block;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, transform 0.3s;
}
nav a:hover {
  background: #004d80;
  transform: translateY(-2px);
}
section {
  padding: 40px 20px;
  max-width: 900px;
  margin: auto;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInSection 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
}
section.show {
  animation-play-state: running;
}
@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
h2 {
  border-bottom: 2px solid #007acc;
  padding-bottom: 5px;
  margin-bottom: 20px;
  color: #007acc;
  transition: color 0.3s;
}
h2:hover {
  color: #005f99;
}
body.dark-mode h2 {
  color: #66d9ef;
}
.skill-bar {
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 15px;
  height: 30px;
}
.skill-bar .bar {
  background: #007acc;
  height: 100%;
  width: 0; /* ban đầu là 0 */
  color: white;
  padding-left: 10px;
  display: flex;
  align-items: center;
  font-weight: bold;
  white-space: nowrap;
  border-radius: 5px 0 0 5px;
  transition: width 1.5s ease-in-out;
}
body.dark-mode .skill-bar .bar {
  background: #66d9ef;
}
footer {
  text-align: center;
  background: #333;
  color: white;
  padding: 20px 0;
  animation: fadeIn 2s ease-in;
}
footer:hover {
  background: #222;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes growBar {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.portfolio-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.portfolio-item {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}
.portfolio-item:hover {
  transform: translateY(-5px);
}
body.dark-mode .portfolio-item {
  background: #1e1e1e;
}
.portfolio-item h3 {
  margin-top: 0;
}
.portfolio-item p {
  margin-bottom: 0;
}
form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
}
form label {
  margin: 10px 0 5px;
}
form input, form textarea {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1em;
  resize: vertical;
}
form button {
  margin-top: 15px;
  padding: 12px;
  background: #007acc;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}
form button:hover {
  background: #005f99;
}
body.dark-mode form input, 
body.dark-mode form textarea {
  background: #333;
  border: 1px solid #555;
  color: #eee;
}
body.dark-mode form button {
  background: #66d9ef;
  color: #121212;
}
body.dark-mode form button:hover {
  background: #559ddf;
}
.download-cv {
  display: block;
  max-width: 200px;
  margin: 20px auto;
  padding: 12px;
  background: #007acc;
  color: white;
  font-weight: bold;
  text-align: center;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s;
}
.download-cv:hover {
  background: #005f99;
}
@keyframes blink {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0;
  }
}
.blinking span {
  animation: blink 2s forwards;
  animation-timing-function: ease-in-out;
}
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 95, 153, 0.7); /* màu nền mờ */
  backdrop-filter: blur(10px);       /* hiệu ứng mờ */
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding: 15px 30px;
}

/* Khi cuộn xuống */
nav.scrolled {
  background: rgba(0, 95, 153, 1);    /* màu nền đậm */
  box-shadow: 0 4px 8px rgba(174, 204, 233, 0.3);
}


.skill-bar:hover .bar {
  background: #005f99;
  box-shadow: 0 0 10px #005f99;
  transition: all 0.3s ease;
}

#scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: #00aaff;
  width: 0%;
  z-index: 9999;
  transition: width 0.2s ease-out;
}

#portfolio-carousel-3d {
  padding: 60px 20px;
  text-align: center;
  background: #ffffff;
  color: #000;
  perspective: 1200px;
  overflow: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.carousel-3d {
  width: 100%;
  height: 320px;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: center center;
  cursor: grab;
   will-change: transform;
  backface-visibility: hidden;
}

.carousel-3d:active {
  cursor: grabbing;
}

.carousel-item {
  position: absolute;
  width: 400px;
  height: 250px;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  margin: -125px 0 0 -200px;
  transition: transform 1s;
}

.carousel-item img {
  width: 80%;
  height: 80%;
  object-fit: cover;
  border-radius: 10px;
  /* //box-shadow: 0 10px 25px rgba(0,0,0,0.5); */
}

.carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(300px); }
.carousel-item:nth-child(2) { transform: rotateY(60deg) translateZ(300px); }
.carousel-item:nth-child(3) { transform: rotateY(120deg) translateZ(300px); }
.carousel-item:nth-child(4) { transform: rotateY(180deg) translateZ(300px); }
.carousel-item:nth-child(5) { transform: rotateY(240deg) translateZ(300px); }
.carousel-item:nth-child(6) { transform: rotateY(300deg) translateZ(300px); }


@keyframes rotateCarousel {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}
.dark-mode #portfolio-carousel-3d {
  background: #121212;
  color: #fff;
}
/* thoi gian */
#widget-clock {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 122, 204, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 999;
  transition: background 0.3s;
}

/* body.dark-mode #widget-clock {
  background: rgba(102, 217, 239, 0.8);
  color: #121212;
} */
/* 
hieu ung 2 ben */
/* #particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  top: 0;
  left: 0;
}

header {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
header > *:not(#particles-js) {
  position: relative;
  z-index: 2;
} */

/* CSS cho từng chữ chạy lên */
#animated-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
  animation-name: riseUp;
  animation-duration: 0.4s;
  animation-timing-function: ease-out;
}

@keyframes riseUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* #animated-projects span {
  opacity: 0;
  transform: translateY(20px);
  display: inline-block;
  animation: fadeInUp 0.3s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
} */
