.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #181818;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 2rem;
  position: relative;
  width: 100%;
  height: 100%;
}

.loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-number {
  font-size: 4.5rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--hover);
  font-weight: 700;
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
  animation: pulse 2s infinite;
  position: absolute;
  bottom: 5rem;
  left: 3rem;
}

.loader-text {
  font-size: 1.8rem;
  text-transform: uppercase;
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  line-height: 2;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.5s;
  position: relative;
  padding: 1rem;
  margin-top: auto;
  margin-bottom: auto;
}

.loader-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--hover);
  border-radius: 2px;
  opacity: 0;
  animation: lineGrow 0.8s ease forwards;
  animation-delay: 1s;
}

.loader-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--hover);
  border-radius: 2px;
  opacity: 0;
  animation: lineGrow 0.8s ease forwards;
  animation-delay: 1.2s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineGrow {
  to {
    width: 200px;
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
  }
}

@media (max-width: 768px) {
  .loader-text {
    font-size: 1.4rem;
    line-height: 1.8;
    padding: 0.8rem;
  }
  
  .loader-number {
    font-size: 3.5rem;
    bottom: 3rem;
    left: 1.5rem;
  }

  .loader-content {
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .loader-text {
    font-size: 1.2rem;
    line-height: 1.6;
    padding: 0.6rem;
  }
  
  .loader-number {
    font-size: 3rem;
    bottom: 2.5rem;
    left: 1rem;
  }
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  min-height: 100vh;
}

body.loading {
  overflow: hidden;
  height: 100vh;
}

.floating-capsule {
  position: fixed;
  bottom: 30px;
  right: 10px;
  background: rgba(245, 235, 224, 0.9);
  border-radius: 50px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  backdrop-filter: blur(5px);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  align-items: center;
  height: 100px;
  overflow: hidden;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.theme-toggle,
.music-toggle,
.scroll-top {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
  flex-shrink: 0;
}

.theme-toggle:hover,
.music-toggle:hover,
.scroll-top:hover {
  background: var(--hover);
  color: var(--white);
  transform: scale(1.1);
}

.theme-toggle i,
.music-toggle i,
.scroll-top i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.music-toggle.playing i {
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Dark mode styles */
body.dark-mode {
  --primary: #1a1a1a;
  --secondary: #2d2d2d;
  --accent: #3d3d3d;
  --text: #ffffff;
  --border: #404040;
  --hover: #4CAF50;
  --white: #ffffff;
}

body.dark-mode .navbar {
  background: rgba(45, 45, 45, 0.85);
  border-bottom: 1px solid var(--border);
}

body.dark-mode .mobile-menu {
  background: rgba(45, 45, 45, 0.95);
}

body.dark-mode .floating-capsule {
  background: rgba(45, 45, 45, 0.9);
}

/* Project section dark mode styles */
body.dark-mode .project-header {
  border-color: var(--hover);
}

body.dark-mode .project-title {
  color: var(--text);
}

body.dark-mode .project-toggle {
  color: var(--text);
}

body.dark-mode .project-content {
  background: var(--secondary);
}

body.dark-mode .project-description {
  color: var(--text);
}

body.dark-mode .project-link {
  color: var(--text);
}

body.dark-mode .project-link:hover {
  color: var(--hover);
}

body.dark-mode .project-item {
  border-color: var(--border);
}

body.dark-mode .projects-section h3 {
  color: var(--text);
}

body.dark-mode .uiux,
body.dark-mode .dev {
  color: var(--text);
}

body.dark-mode .uiux::after,
body.dark-mode .dev::after {
  background-color: var(--hover);
}

body.dark-mode .active-category::after {
  background-color: var(--hover);
}

/* Light mode styles */
body.light-mode {
  --primary: #d6ccc2;
  --secondary: #edede9;
  --accent: #f5ebe0;
  --text: #181818;
  --border: #bdbdbd;
  --hover: #00945b;
  --white: #fff;
}

body.light-mode .navbar {
  background: rgba(245, 235, 224, 0.85);
  border-bottom: 1px solid var(--border);
}

body.light-mode .mobile-menu {
  background: rgba(245, 235, 224, 0.95);
}

body.light-mode .floating-capsule {
  background: rgba(245, 235, 224, 0.9);
}

/* Theme toggle icon visibility */
.theme-toggle .fa-sun {
  display: none;
}

body.dark-mode .theme-toggle .fa-sun {
  display: block;
}

body.dark-mode .theme-toggle .fa-moon {
  display: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .password-protected{
    text-wrap: wrap;
  }
  .floating-capsule {
    bottom: 60px;
    right: 10px;
    padding: 8px;
    height: 90px;
  }

  .floating-capsule:has(.scroll-top.visible) {
    height: 140px;
  }

  .theme-toggle,
  .music-toggle {
    width: 35px;
    height: 35px;
  }

  .theme-toggle i,
  .music-toggle i {
    font-size: 1rem;
  }

  .scroll-top {
    width: 35px;
    height: 0;
  }

  .scroll-top.visible {
    width: 35px;
    height: 35px;
  }
}

.project-item[data-id="5"] .project-image {
  width: auto;
  max-width: 250px;
  height: auto;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.project-item[data-id="5"] .carousel-slide {
  flex: 0 0 auto;
  margin: 0 10px;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px; /* Fixed height container */
  width: 250px; /* Fixed width container */
}

/* Responsive styles for carousel */
@media (max-width: 768px) {
  .project-item[data-id="5"] .project-image {
    max-width: 200px;
    max-height: 250px;
  }
  
  .project-item[data-id="5"] .carousel-slide {
    height: 250px;
    width: 200px;
  }
}

@media (max-width: 480px) {
  .project-item[data-id="5"] .project-image {
    max-width: 150px;
    max-height: 200px;
  }
  
  .project-item[data-id="5"] .carousel-slide {
    margin: 0 5px;
    height: 200px;
    width: 150px;
  }
}

.bento-section {
  padding: 4rem 2rem;
  width: 80%;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

.bento-title {
  font-size: 4.5rem;
  margin-bottom: 2rem;
  color: var(--text);
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
}

.bento-grid {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: 1rem;
  padding: 1rem;
  background: var(--border);
  opacity: 0.8;
}

.bento-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  will-change: transform, opacity;
  transition: all 0.3s ease;
  background: var(--accent);
  flex: 1;
  min-width: 0;
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0.3s ease;
}

/* Responsive styles */
@media (max-width: 1400px) {
  .bento-section {
    padding: 3rem 1.5rem;
    width: 85%;
  }
  
  .bento-grid {
    height: 180px;
  }
}

@media (max-width: 1024px) {
  .bento-section {
    width: 90%;
  }
  
  .bento-grid {
    height: 160px;
  }
}

@media (max-width: 768px) {
  .bento-section {
    padding: 2rem 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
  }
  
  .bento-title {
    font-size: 2.5rem;
    width: 100%;
    text-align: center;
  }
  
  .bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 0.6rem;
    height: auto;
    aspect-ratio: 1/1;
    padding: 0.6rem;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .bento-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    aspect-ratio: 1 !important;
    width: 100%;
    height: 100%;
  }

  .bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .projects-section,
  .skills-section,
  .contact-section {
    width: 100%;
    padding: 2rem 0.5rem;
    box-sizing: border-box;
  }

  .card-container,
  .card-container-dev {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .bento-section {
    padding: 1.5rem 0.5rem;
  }
  
  .bento-grid {
    width: 95%;
    gap: 0.4rem;
    padding: 0.4rem;
  }
  
  .bento-title {
    font-size: 2rem;
  }

  .projects-section,
  .skills-section,
  .contact-section {
    padding: 1.5rem 0.5rem;
  }
}

.bento-item:hover {
  transform: scale(1.02);
  z-index: 2;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.bento-item:hover img {
  transform: scale(1.05);
}

/* Dark mode adjustments */
body.dark-mode .bento-grid {
  background: var(--border);
  opacity: 0.9;
}

body.dark-mode .bento-item {
  background: var(--secondary);
}

.bento-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item.wide {
  grid-column: span 2;
}

.bento-item.tall {
  grid-row: span 2;
}

.bento-content {
  position: absolute;
  inset: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  transition: all 0.3s ease;
}

.bento-content h3 {
  font-size: 1rem;
  margin: 0;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.bento-content p {
  font-size: 0.75rem;
  margin: 0.3rem 0 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.bento-item:hover .bento-content {
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3));
}

.bento-item:hover .bento-content h3,
.bento-item:hover .bento-content p {
  transform: translateY(0);
  opacity: 1;
}

.bento-item i {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 1.2rem;
  color: var(--hover);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.bento-item:hover i {
  transform: scale(1.2) rotate(5deg);
  opacity: 1;
}

/* Dynamic hover effects for different items */
.bento-item:nth-child(1):hover {
  background: linear-gradient(45deg, var(--hover), #2c3e50);
}

.bento-item:nth-child(2):hover {
  background: linear-gradient(45deg, #e74c3c, var(--hover));
}

.bento-item:nth-child(3):hover {
  background: linear-gradient(45deg, #3498db, var(--hover));
}

.bento-item:nth-child(4):hover {
  background: linear-gradient(45deg, #9b59b6, var(--hover));
}

.bento-item:nth-child(5):hover {
  background: linear-gradient(45deg, #f1c40f, var(--hover));
}

.bento-item:nth-child(6):hover {
  background: linear-gradient(45deg, #1abc9c, var(--hover));
}

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .bento-item.large {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 600px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.6rem;
  }
  
  .bento-item.large,
  .bento-item.wide {
    grid-column: span 1;
  }
  
  .bento-content h3 {
    font-size: 0.9rem;
  }
  
  .bento-content p {
    font-size: 0.7rem;
  }
  
  .bento-item i {
    font-size: 1rem;
  }
}

/* Contact Form Styles */
.contact-section {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.contact-section h3 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.form-group {
  position: relative;
  width: 100%;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: none;
  border-bottom: 2px solid var(--hover);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--hover);
  box-shadow: 0 2px 0 var(--hover);
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  opacity: 0.5;
  transform: translateY(-0.5rem);
}

.submit-btn {
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 2px solid var(--hover);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-end;
  position: relative;
}

.submit-btn:hover {
  color: var(--white);
  background: var(--hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 148, 91, 0.2);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Dark mode styles for contact form */
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  background: transparent;
  color: var(--text);
  border-bottom-color: var(--hover);
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder {
  color: var(--text);
}

/* Mobile responsiveness for contact form */
@media (max-width: 768px) {
  .contact-section {
    margin: 2rem auto;
    padding: 0 1rem;
    width: 90%;
  }

  .contact-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.8rem;
    width: 90%;
    margin: 0 auto;
  }

  .submit-btn {
    width: 90%;
    margin: 0 auto;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .contact-section {
    width: 90%;
    padding: 0 0.5rem;
  }

  .form-group input,
  .form-group textarea {
    width: 90%;
    font-size: 0.9rem;
  }

  .submit-btn {
    width: 90%;
    font-size: 0.9rem;
  }
}

/* Footer Styles */
.footer {
  padding: 2rem;
  background: var(--secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-contact {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.contact-info:hover {
  color: var(--hover);
  transform: translateY(-2px);
}

.contact-info i {
  color: var(--hover);
}

.mobile-email {
  display: none;
}

.desktop-email {
  display: flex;
}

.footer-socials {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.footer-socials a {
  color: var(--text);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.footer-socials a:hover {
  color: var(--hover);
  transform: translateY(-2px);
}

/* Mobile Responsive Footer */
@media (max-width: 768px) {
  .footer {
    padding: 1rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .footer-contact {
    gap: 1rem;
  }

  .contact-info {
    font-size: 0.85rem;
  }

  .desktop-email {
    display: none;
  }

  .mobile-email {
    display: flex;
    font-size: 1.1rem;
    color: var(--text);
  }

  .mobile-email:hover {
    color: var(--hover);
    transform: translateY(-2px);
  }

  .footer-socials {
    gap: 1rem;
  }

  .footer-socials a {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 0.8rem;
  }

  .footer-contact {
    gap: 0.8rem;
  }

  .contact-info {
    font-size: 0.75rem;
  }

  .mobile-email {
    font-size: 1rem;
  }

  .footer-socials {
    gap: 0.8rem;
  }

  .footer-socials a {
    font-size: 1rem;
  }
}

.uiux,
.dev {
  position: relative;
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .uiux,
  .dev {
    margin: 0 1rem;
    padding: 0.5rem 1.5rem;
  }
  
  .projects-section {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .uiux,
  .dev {
    margin: 0 0.8rem;
    padding: 0.4rem 1.2rem;
    font-size: 1rem;
  }
}

.scroll-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  height: 0;
  margin: 0;
  padding: 0;
  width: 40px;
  flex-shrink: 0;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  height: 40px;
  margin: 0;
  padding: 0;
  width: 40px;
}

/* When scroll-top is visible, adjust capsule height */
.floating-capsule:has(.scroll-top.visible) {
  height: 150px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
