@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Advanced Color System */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.2);
    --backdrop-blur: blur(20px);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-neon: 0 0 40px rgba(102, 126, 234, 0.4);
    
    /* 3D Transform Variables */
    --rotate-x: 0deg;
    --rotate-y: 0deg;
    --rotate-z: 0deg;
    --translate-z: 0px;
    --perspective: 1000px;
  }

  html {
    scroll-behavior: smooth;
    font-size: 16px;
  }

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
  }

  * {
    box-sizing: border-box;
  }

  ::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #ffffff;
  }
}

@layer components {
  /* Revolutionary Navigation */
  .nav-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 8px 24px;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-container:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: var(--shadow-neon);
  }

  .nav-logo {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
  }

  .nav-link {
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-decoration: none;
  }

  .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
  }

  .nav-link:hover::after {
    width: 80%;
  }

  /* Revolutionary Hero Section */
  .hero-revolution {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    overflow: hidden;
    perspective: var(--perspective);
  }

  /* Advanced Background System */
  .bg-orbs {
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    animation: float-3d 20s ease-in-out infinite;
  }

  .orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
  }

  .orb-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.3) 0%, transparent 70%);
    bottom: -5%;
    left: -5%;
    animation-delay: -5s;
  }

  .orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.35) 0%, transparent 70%);
    top: 30%;
    left: 20%;
    animation-delay: -10s;
  }

  .orb-4 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(250, 112, 154, 0.25) 0%, transparent 70%);
    top: 20%;
    right: 30%;
    animation-delay: -15s;
  }

  /* 3D Grid Background */
  .grid-3d {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: 
      linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(45deg) scale(2);
    opacity: 0.3;
    animation: grid-pulse 4s ease-in-out infinite;
  }

  /* Hero Content */
  .hero-content-revolutionary {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
  }

  .hero-title-revolutionary {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.05em;
    animation: title-glow 3s ease-in-out infinite;
  }

  .hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    font-weight: 400;
    line-height: 1.4;
  }

  .hero-cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
  }

  .cta-primary {
    position: relative;
    padding: 16px 32px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  }

  .cta-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
  }

  .cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
  }

  .cta-primary:hover::before {
    left: 100%;
  }

  .cta-secondary {
    position: relative;
    padding: 16px 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.3s ease;
  }

  .cta-secondary:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
  }

  /* Floating Stats */
  .floating-stats {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3rem;
  }

  .stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    text-align: center;
    min-width: 120px;
    transition: all 0.3s ease;
  }

  .stat-card:hover {
    transform: translateY(-5px) rotateY(5deg);
    background: rgba(255, 255, 255, 0.12);
  }

  .stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
  }

  .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-top: 0.5rem;
  }

  /* Revolutionary Sections */
  .section-revolutionary {
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
  }

  .section-dark {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
  }

  .section-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  }

  /* 3D Service Cards */
  .services-revolutionary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    perspective: 1000px;
  }

  .service-card-3d {
    position: relative;
    height: 400px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
  }

  .service-card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg) translateZ(20px);
  }

  .service-card-face {
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backface-visibility: hidden;
    transition: all 0.3s ease;
  }

  .service-card-3d:hover .service-card-face {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-neon);
  }

  .service-icon-3d {
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .service-icon-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
  }

  .service-card-3d:hover .service-icon-3d::before {
    transform: translateX(100%);
  }

  .service-title-3d {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
  }

  .service-description-3d {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 2rem;
  }

  .service-link-3d {
    margin-top: auto;
    padding: 12px 24px;
    background: var(--secondary-gradient);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
  }

  .service-link-3d:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
  }

  /* Revolutionary About Section */
  .about-revolutionary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
  }

  .about-content {
    position: relative;
  }

  .about-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
  }

  .about-text {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.7;
  }

  .tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
  }

  .tech-tag {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.3s ease;
  }

  .tech-tag:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
  }

  /* 3D Skills Visualization */
  .skills-3d {
    position: relative;
    height: 500px;
    perspective: 1000px;
  }

  .skill-orb {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: float-skill 6s ease-in-out infinite;
  }

  .skill-orb:hover {
    transform: translateZ(30px) scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-neon);
  }

  .skill-orb:nth-child(1) {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
  }

  .skill-orb:nth-child(2) {
    top: 30%;
    right: 10%;
    animation-delay: -1s;
  }

  .skill-orb:nth-child(3) {
    bottom: 30%;
    left: 10%;
    animation-delay: -2s;
  }

  .skill-orb:nth-child(4) {
    bottom: 10%;
    right: 30%;
    animation-delay: -3s;
  }

  .skill-orb:nth-child(5) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -4s;
  }

  /* Revolutionary Contact Section */
  .contact-revolutionary {
    background: radial-gradient(ellipse at center, rgba(240, 147, 251, 0.1) 0%, transparent 50%),
                linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    padding: 8rem 0;
    position: relative;
  }

  .contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
  }

  .contact-info {
    position: relative;
  }

  .contact-form-revolutionary {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
  }

  .contact-form-revolutionary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: rotate-border 8s linear infinite;
    z-index: -1;
  }

  .form-group-revolutionary {
    margin-bottom: 2rem;
    position: relative;
  }

  .form-input-revolutionary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .form-input-revolutionary:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
  }

  .form-input-revolutionary::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .form-label-revolutionary {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #0a0a0a;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
  }

  .submit-btn-revolutionary {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .submit-btn-revolutionary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
  }

  .submit-btn-revolutionary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
  }

  .submit-btn-revolutionary:hover::before {
    left: 100%;
  }
}

/* Advanced Animations */
@keyframes float-3d {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) translateZ(0px) rotateY(0deg);
  }
  25% { 
    transform: translateY(-20px) translateX(10px) translateZ(10px) rotateY(90deg);
  }
  50% { 
    transform: translateY(-10px) translateX(-10px) translateZ(20px) rotateY(180deg);
  }
  75% { 
    transform: translateY(-30px) translateX(15px) translateZ(10px) rotateY(270deg);
  }
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

@keyframes title-glow {
  0%, 100% { 
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  }
  50% { 
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.8), 0 0 60px rgba(118, 75, 162, 0.4);
  }
}

@keyframes float-skill {
  0%, 100% { 
    transform: translateY(0px) rotateX(0deg);
  }
  33% { 
    transform: translateY(-15px) rotateX(15deg);
  }
  66% { 
    transform: translateY(-5px) rotateX(-10deg);
  }
}

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

@keyframes particle-drift {
  0% { 
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 1;
  }
  100% { 
    transform: translateY(-10vh) translateX(100px) scale(0);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .nav-container {
    top: 10px;
    padding: 6px 20px;
  }

  .hero-title-revolutionary {
    font-size: clamp(2.5rem, 6vw, 5rem);
  }

  .about-revolutionary {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .services-revolutionary {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .floating-stats {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }

  .cta-primary, .cta-secondary {
    width: 100%;
    max-width: 300px;
  }

  .services-revolutionary {
    grid-template-columns: 1fr;
  }

  .skill-orb {
    width: 100px;
    height: 100px;
    font-size: 0.75rem;
  }

  .tech-stack {
    justify-content: center;
  }

  .section-revolutionary {
    padding: 4rem 0;
  }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
}