/* ========================================
   LANDSCAPE ERP LIBRARY - PREMIUM DARK THEME
   Adapted from Portfolio Theme
   ======================================== */

/* ===== CSS VARIABLES & RESET ===== */
:root {
  /* Dark Theme Colors */
  --bg: #0a0c12;
  --bg-secondary: #0f1117;
  --card-bg: #11151d;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #7dd3fc;
  --accent2: #a7f3d0;
  --border: rgba(255, 255, 255, 0.10);
  
  /* Radius */
  --radius1: 14px;
  --radius2: 18px;
  
  /* Easing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Mouse tracking (for effects) */
  --mouse-x: 50%;
  --mouse-y: 50%;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.3);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 211, 252, 0.5);
}

/* ===== TOPBAR / NAVIGATION ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 22, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}

.logo:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s var(--ease);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius1);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  text-decoration: none;
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), rgba(125, 211, 252, 0.8));
  color: #000;
  box-shadow: 0 4px 16px rgba(125, 211, 252, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(125, 211, 252, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 60px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-inner {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-description {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== SEARCH BAR ===== */
.search-container {
  max-width: 600px;
  margin: 32px auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  border-radius: var(--radius2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  transition: all 0.3s var(--ease);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.1);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
}

/* ===== FILTER PANEL ===== */
.filter-panel {
  max-width: 1400px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.filter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  user-select: none;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip.active {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.2), rgba(167, 243, 208, 0.2));
  border-color: var(--accent);
  color: var(--accent);
}

.chip-icon {
  font-size: 16px;
}

/* ===== PROJECT GRID ===== */
.projects-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ===== PROJECT CARD ===== */
.project-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.4s var(--ease);
  cursor: pointer;
  will-change: transform;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 
              0 0 0 1px rgba(125, 211, 252, 0.1);
}

/* Glass morphism effect on hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-local-x, 50%) var(--mouse-local-y, 50%),
    rgba(125, 211, 252, 0.08),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
  z-index: 1;
}

.project-card:hover::before {
  opacity: 1;
}

.project-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  filter: saturate(1.08) contrast(1.04) brightness(0.95);
}

.project-card:hover .project-cover img {
  transform: scale(1.08);
}

.project-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(11, 15, 22, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.project-badge.featured {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.3));
  border-color: rgba(251, 191, 36, 0.5);
  color: #fcd34d;
}

.project-badge.video {
  background: linear-gradient(135deg, rgba(167, 243, 208, 0.3), rgba(110, 231, 183, 0.3));
  border-color: rgba(167, 243, 208, 0.5);
  color: #a7f3d0;
}

.project-info {
  padding: 20px;
  position: relative;
  z-index: 2;
}

.project-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.3;
}

.project-meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

/* ===== PREMIUM ENHANCEMENTS ===== */

/* Cursor Glow Effect */
body:not(.hide-cursor-glow) #cursorGlow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(-50%, -50%);
}

body:not(.hide-cursor-glow) #cursorGlow.active {
  opacity: 1;
}

/* Magnetic Button Effect */
body:not(.hide-magnetic-effect) .btn-primary {
  transition: transform 0.2s ease;
}

/* 3D Card Tilt Effect */
body:not(.hide-3d-tilt) .project-card {
  transform-style: preserve-3d;
}

body:not(.hide-3d-tilt) .project-card:hover {
  transform: 
    translateY(-8px)
    rotateX(calc((var(--mouse-local-y, 50) - 50) * 0.1deg))
    rotateY(calc((var(--mouse-local-x, 50) - 50) * -0.1deg));
}

/* Topbar Shimmer */
body:not(.hide-topbar-shimmer) .topbar {
  position: relative;
  overflow: hidden;
}

body:not(.hide-topbar-shimmer) .topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--accent), 
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

/* Disable all animations */
body.hide-animations * {
  animation: none !important;
  transition: none !important;
}

/* ===== FEATURE TOGGLE PANEL ===== */
.feature-toggle-panel {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.3s var(--ease);
}

.feature-toggle-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.toggle-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.toggle-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.close-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.close-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.toggle-group {
  margin-bottom: 16px;
}

.toggle-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.toggle-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s var(--ease);
  border: 1px solid var(--border);
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--accent), rgba(125, 211, 252, 0.8));
  border-color: var(--accent);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(20px);
}

.toggle-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.toggle-action-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.toggle-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Settings button */
.settings-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 201;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-btn:hover {
  transform: scale(1.05) rotate(90deg);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(125, 211, 252, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .hero-title {
    font-size: 42px;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .nav-links {
    display: none;
  }
  
  .feature-toggle-panel {
    width: 90vw;
    right: 5vw;
  }
}

@media (max-width: 560px) {
  .hero-title {
    font-size: 32px;
  }
  
  .hero-description {
    font-size: 16px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .settings-btn {
    width: 44px;
    height: 44px;
    top: 16px;
    right: 16px;
  }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.empty-description {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* ===== LOADING STATE ===== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(125, 211, 252, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 80px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s var(--ease);
}

.footer-link:hover {
  color: var(--accent);
}