/* Global Styles */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode Base */
body.dark-mode {
  background-color: #121212;
  color: #e6e6e6;
}

/* Light Mode Base */
body.light-mode {
  background-color: #f9f9f9;
  color: #333;
}

/* Fade-in scroll animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

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

  to {
    transform: rotate(360deg);
  }
}

@keyframes zoomIn {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff9f00, #ff6b6b);
  z-index: 10000;
  width: 0%;
  pointer-events: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: #ff9f00;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 159, 0, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: #e88e00;
}

/* ===== PAGE LOADER ===== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.light-mode .page-loader {
  background: #f9f9f9;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 159, 0, 0.2);
  border-top-color: #ff9f00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== CUSTOM CURSOR ===== */
@media (hover: hover) and (pointer: fine) {
  * { cursor: none !important; }
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #ff9f00;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100001;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 159, 0, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100000;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

.cursor-ring.hover {
  width: 50px;
  height: 50px;
  border-color: rgba(255, 107, 107, 0.7);
}

/* ===== PAGE TRANSITION ===== */
.page-transition {
  position: fixed;
  inset: 0;
  background: #121212;
  z-index: 100002;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

body.light-mode .page-transition {
  background: #f9f9f9;
}

/* ===== TEXT REVEAL ===== */
.text-reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.text-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== NOISE/GRAIN OVERLAY ===== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='.15'/%3E%3C/svg%3E");
}

/* Responsive base */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .floating-social {
    top: auto;
    bottom: 20px;
    flex-direction: row;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .back-to-top {
    right: 16px;
    bottom: 80px;
  }

  .floating-social {
    display: none;
  }
}
