/* Custom styles, glows, animations, and glassmorphism for Saberi.pro */

:root {
  --color-bg: #08090d;
  --color-surface: #0e1118;
  --color-card: rgba(17, 21, 32, 0.7);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-glow: rgba(36, 112, 255, 0.3);
  --neon-blue: #2470ff;
  --neon-cyan: #00d2ff;
  --neon-purple: #8b1fff;
  --neon-crimson: #ff385c;
  --neon-amber: #ff9429;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--color-bg);
  color: #f3f4f6;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #08090d;
}
::-webkit-scrollbar-thumb {
  background: #1e2433;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2470ff;
}

/* Background Animated Gradient Mesh - Contained strictly within screen */
.ambient-glow-blue {
  position: absolute;
  top: -5%;
  left: 0%;
  width: min(600px, 95vw);
  height: min(600px, 95vw);
  background: radial-gradient(circle, rgba(36, 112, 255, 0.18) 0%, rgba(36, 112, 255, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 10s ease-in-out infinite alternate;
}

.ambient-glow-crimson {
  position: absolute;
  top: 15%;
  right: 0%;
  width: min(550px, 90vw);
  height: min(550px, 90vw);
  background: radial-gradient(circle, rgba(255, 56, 92, 0.15) 0%, rgba(255, 56, 92, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 12s ease-in-out infinite alternate-reverse;
}

.ambient-glow-purple {
  position: absolute;
  bottom: 20%;
  left: 10%;
  width: min(700px, 90vw);
  height: min(700px, 90vw);
  background: radial-gradient(circle, rgba(139, 31, 255, 0.1) 0%, rgba(139, 31, 255, 0) 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

/* Grid background overlay */
.bg-cyber-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Glassmorphism */
.glass-panel {
  background: rgba(14, 18, 28, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-panel-hover {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  background: rgba(20, 26, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 25px -5px rgba(36, 112, 255, 0.2);
}

/* Glowing Rim Card for Portrait */
.portrait-glow-wrapper {
  position: relative;
  border-radius: 28px;
  padding: 3px;
  background: linear-gradient(135deg, #00d2ff 0%, #2470ff 30%, #8b1fff 60%, #ff385c 100%);
  box-shadow: 0 0 35px -5px rgba(36, 112, 255, 0.4), 0 0 35px -5px rgba(255, 56, 92, 0.4);
  max-width: 100%;
}

.portrait-inner {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: #08090d;
}

.portrait-inner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Animated Floating Elements */
@keyframes floatAnim {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

.float-element {
  animation: floatAnim 6s ease-in-out infinite;
}

.float-element-delayed {
  animation: floatAnim 7s ease-in-out infinite 1.5s;
}

/* Gradient Text Utilities */
.text-gradient-cyan-blue {
  background: linear-gradient(135deg, #ffffff 10%, #00d2ff 60%, #2470ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue-purple {
  background: linear-gradient(135deg, #2470ff 0%, #8b1fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-amber-crimson {
  background: linear-gradient(135deg, #ff9429 0%, #ff385c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple-magenta {
  background: linear-gradient(135deg, #fb2ec1 0%, #7834e7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan-emerald {
  background: linear-gradient(135deg, #0acffe 0%, #495aff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald-teal {
  background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-crimson-coral {
  background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Pulse Glow & Gradient Rotation */
@keyframes gradientRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {
  0% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Pulse Dot */
.pulse-dot {
  position: relative;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background-color: inherit;
  opacity: 0.6;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Terminal Console Styling */
.terminal-window {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px -5px rgba(36, 112, 255, 0.15);
}

.terminal-header {
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: #00d2ff;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Toast styling */
#toast-notification {
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* Project Filter Tabs Active State */
.filter-btn.active {
  background: linear-gradient(135deg, rgba(36, 112, 255, 0.2), rgba(139, 31, 255, 0.2));
  border-color: rgba(0, 210, 255, 0.5);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
}

/* Project Card transitions */
.project-card {
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
}

.project-card.hidden-card {
  display: none;
  opacity: 0;
  transform: scale(0.95);
}
