@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark theme (default) */
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --text-muted: #aaa;
  --text-footer: #777;
  --accent-primary: #7e0b0b;
  --accent-secondary: #a71414;
  --border-color: #333;
  --card-shadow: rgba(126, 11, 11, 0.3);
  --particle-color: 126, 11, 11;
}

[data-theme="light"] {
  /* Light theme */
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #888;
  --text-footer: #999;
  --accent-primary: #7e0b0b;
  --accent-secondary: #a71414;
  --border-color: #e0e0e0;
  --card-shadow: rgba(196, 30, 58, 0.2);
  --particle-color: 196, 30, 58;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: all 0.4s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}
a:hover {
  color: var(--accent-primary);
}

/* Theme Toggle Switch */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  padding: 10px 15px;
  border-radius: 25px;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--card-shadow);
}

.theme-icon {
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--border-color);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.switch.active {
  background: var(--accent-primary);
}

.slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.switch.active .slider {
  transform: translateX(24px);
}

/* Header */
header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1rem 2rem;
}
header h1 {
  font-size: 2.5rem;
  color: var(--accent-primary);
  letter-spacing: -3px;
  text-shadow: 0 0 10px var(--card-shadow);
}
header p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-secondary);
}
.cta-btn {
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  padding: 0.8rem 1.6rem;
  border-radius: 30px;
  color: #fff;
  font-weight: bold;
  display: inline-block;
  transition: transform 0.3s, box-shadow 0.3s;
}
.cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--card-shadow);
  color: var(--bg-primary);
}

/* Filter Nav */
.filter-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}
.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--card-shadow);
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 6rem;
}
.card {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s ease;
  border: 1px solid var(--border-color);
}
.card:hover {
  transform: scale(1.03) translateY(-5px);
  box-shadow: 0 10px 25px var(--card-shadow);
}
.card img {
  width: 100%;
  display: block;
  transition: all 0.3s ease;
}
.card:hover img {
  transform: scale(1.05);
}
.card-content {
  padding: 1rem;
}
.card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.tech-stack {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding: 0.3rem 0.6rem;
  background: var(--border-color);
  border-radius: 10px;
  display: inline-block;
}
.links a {
  margin-right: 1rem;
  font-size: 0.9rem;
  color: var(--accent-primary);
  transition: all 0.3s;
  font-weight: 700;
}
.links a:hover {
  transform: translateX(3px);
  color: var(--accent-secondary);
}
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #fff;
}

/* Design Notes */
.design-notes {
  padding: 2rem;
  text-align: center;
}
.design-notes h2 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
}
.note {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 4px solid var(--accent-primary);
}
.note.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  color: var(--text-footer);
  background: var(--bg-secondary);
}
footer p {
  margin: 0.5rem 0;
}
footer a:hover {
  color: var(--accent-primary);
}

/* Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Pulse animation for active elements */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 0.3s ease;
}

/* Demo Modal */
.demo-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.demo-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.demo-content {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  transform: scale(0.9);
  animation: modalSlideIn 0.3s ease forwards;
}

.close-demo {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
}

.close-demo:hover {
  color: var(--accent-primary);
}

.demo-login {
  text-align: center;
}

.demo-login h3 {
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.demo-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-input {
  padding: 0.8rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.demo-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--card-shadow);
}

.demo-btn {
  padding: 0.8rem;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.demo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--card-shadow);
}

.demo-forgot {
  margin-top: 1rem;
  color: var(--accent-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s;
}

.demo-forgot:hover {
  color: var(--accent-secondary);
}

@keyframes modalSlideIn {
  to {
    transform: scale(1);
  }
}