/* ============================================
   PREMIUM PORTFOLIO DESIGN - ENHANCED
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --accent: #00f2fe;
  --pink: #f093fb;
  --coral: #f5576c;
  --dark-bg: #0f0c29;
  --darker-bg: #050211;
  --text-primary: #ffffff;
  --text-secondary: #b8b8d1;
  --text-muted: #7c7c9a;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.1);
  --glow-primary: rgba(102, 126, 234, 0.6);
  --glow-accent: rgba(0, 242, 254, 0.4);
}

/* --- General Reset & Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 12, 41, 0.3);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #667eea, #764ba2);
  border-radius: 6px;
  transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00f2fe, #667eea);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #f093fb, #00f2fe);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #667eea rgba(15, 12, 41, 0.3);
}

/* --- Animated Background with Particles --- */
.background-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-glow::before,
.background-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
}

.background-glow::before {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--primary), transparent);
  top: -350px;
  left: -200px;
  animation: float1 20s infinite ease-in-out alternate;
}

.background-glow::after {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent), transparent);
  bottom: -300px;
  right: -150px;
  animation: float2 25s infinite ease-in-out alternate-reverse;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(100px, -50px) rotate(120deg); }
  66% { transform: translate(-50px, 80px) rotate(240deg); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, -60px) scale(1.2); }
}

/* --- Ripple Canvas --- */
#rippleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* --- Navigation Header --- */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(15, 12, 41, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-bracket {
  color: var(--accent);
  font-family: 'Courier New', monospace;
  animation: pulse 2s infinite;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 80px 40px;
}

.hero-content {
  text-align: center;
  max-width: 900px;
}

.hero-label {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.hero-name {
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 8s ease infinite, fadeInUp 0.8s ease 0.4s backwards;
  line-height: 1.1;
  letter-spacing: -2px;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-secondary);
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

.hero-description {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease 0.8s backwards;
  line-height: 1.6;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Projects Section --- */
main {
  padding: 100px 40px;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 15px;
  animation: fadeInUp 0.8s ease;
}

.title-underline {
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 0 auto;
  border-radius: 2px;
  animation: expandWidth 0.8s ease 0.3s backwards;
}

@keyframes expandWidth {
  from { width: 0; }
  to { width: 100px; }
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Project Cards --- */
.project-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0 !important;
  transform: translateY(60px);
}

.project-card.visible {
  opacity: 1 !important;
  transform: translateY(0);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--glow-primary), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-card:hover .card-glow {
  opacity: 0.3;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3),
              0 0 40px rgba(0, 242, 254, 0.2);
}

.project-card.discontinued {
  opacity: 0.7;
}

.project-card.discontinued:hover {
  opacity: 0.9;
}

.project-card.discontinued.visible {
  opacity: 0.7;
}

.card-content {
  position: relative;
  z-index: 2;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.project-card:hover .card-icon {
  animation: none;
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s ease;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-description {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 25px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tag {
  padding: 6px 14px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-card:hover .tag {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.discontinued-tag {
  background: rgba(245, 87, 108, 0.15);
  border-color: rgba(245, 87, 108, 0.3);
  color: var(--coral);
}

.card-arrow {
  position: absolute;
  bottom: 30px;
  right: 30px;
  font-size: 2rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.project-card:hover .card-arrow {
  transform: translateX(10px);
  color: var(--accent);
}

/* --- Contact Section --- */
.contact-section {
  padding: 100px 40px;
  position: relative;
  z-index: 1;
  background: rgba(5, 2, 17, 0.3);
}

.contact-container {
  max-width: 1000px;
  margin: 0 auto;
}

.contact-content {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  width: 100%;
}

.contact-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  animation: fadeInUp 0.8s ease backwards;
}

.contact-item:nth-child(1) { animation-delay: 0.2s; }
.contact-item:nth-child(2) { animation-delay: 0.3s; }
.contact-item:nth-child(3) { animation-delay: 0.4s; }

.contact-item:hover {
  transform: translateY(-8px);
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.contact-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.contact-details h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.contact-details a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
}

.contact-details a:hover {
  color: var(--accent);
}

.contact-details p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

/* --- Footer --- */
footer {
  background: rgba(5, 2, 17, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 60px 40px 30px;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin-bottom: 30px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 15px;
  align-items: center;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-link:hover {
  color: var(--accent);
}

.separator {
  color: var(--text-muted);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .nav-container {
    padding: 20px 30px;
  }

  .hero-name {
    font-size: 4rem;
  }

  .hero-subtitle {
    font-size: 1.7rem;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    gap: 20px;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .hero {
    min-height: 80vh;
    padding: 60px 20px;
  }

  .hero-name {
    font-size: 3rem;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 1.4rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  main {
    padding: 60px 20px;
  }

  .project-card {
    padding: 30px;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.2rem;
  }

  .nav-links {
    gap: 15px;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .card-title {
    font-size: 1.3rem;
  }
}

/* --- Password Modal --- */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 12, 41, 0.98), rgba(48, 43, 99, 0.95));
  margin: 12% auto;
  padding: 50px 45px;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 28px;
  width: 90%;
  max-width: 480px;
  box-shadow: 
    0 25px 70px rgba(102, 126, 234, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.8;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(-30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin: 0 0 15px 0;
  background: linear-gradient(135deg, #667eea, #00f2fe);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-content p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 1rem;
  opacity: 0.9;
}

.modal-content input[type="password"] {
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 10px;
  border: 2px solid rgba(102, 126, 234, 0.25);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

.modal-content input[type="password"]::placeholder {
  color: rgba(184, 184, 209, 0.5);
}

.modal-content input[type="password"]:focus {
  border-color: #667eea;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 0 25px rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

#errorMessage {
  color: #ff6b6b;
  text-align: center;
  margin: 15px 0;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 24px;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.modal-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.modal-buttons button {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.modal-buttons button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modal-buttons button:active::before {
  width: 300px;
  height: 300px;
}

#submitPassword {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#submitPassword:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #7e8ff2, #8a5cb8);
}

#submitPassword:active {
  transform: translateY(-1px);
}

#cancelPassword {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

#cancelPassword:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#cancelPassword:active {
  transform: translateY(-1px);
}
