/*
    A Documentation website about the organization: PROJECT TEST
    Copyright (C) 2024  ProjectTEST

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/* CSS Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #10A2D7;
  --primary-light: #2dc0f5;
  --primary-dark: #0882b2;
  --accent: #E91E63;
  --background: #0a0a10;
  --surface: #16161e;
  --surface-light: #21212d;
  --text: #f0f0f5;
  --text-secondary: #a0a0b0;
  --success: #4CAF50;
  --info: #03A9F4;
  --purple: #9C27B0;
}

/* General Styles */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 16, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(90deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu li a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.nav-menu li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transition: width 0.3s ease;
}

.nav-menu li a:hover {
  color: var(--primary-light);
}

.nav-menu li a:hover::after {
  width: 100%;
}

/* Updated Mobile Menu Styles - improved & consolidated */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: right 0.35s ease-in-out;
    z-index: 999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    overflow-y: auto;
  }
  
  /* This is the key style for showing the menu when active */
  .nav-menu.active {
    right: 0;
    z-index: 1010 !important;
  }
  
  .nav-menu li {
    width: 100%;
    text-align: center;
  }
  
  .nav-menu li a {
    display: block;
    padding: 1rem 0;
    font-size: 1.2rem;
  }
}

/* Hero Section */
.hero {
  position: relative; /* Ensure positioning context for absolute children */
  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Vertically center content */
  justify-content: center; /* Horizontally center content */
  min-height: 60vh; /* Adjust height as needed */
  text-align: center; /* Center text within hero-content */
  overflow: hidden; /* Prevent canvas overflow issues */
  background: linear-gradient(to bottom, var(--background), rgba(22, 22, 30, 0.5));
  position: relative;
}

#nnCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* Ensure canvas is behind content */
}

.hero-content {
  position: relative; /* Ensure content is above canvas */
  z-index: 1; /* Ensure content is above canvas */
  max-width: 800px;
  padding: 2rem;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.hero-title::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(16, 162, 215, 0.3);
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-tag {
  background: var(--surface-light);
  color: var(--text-secondary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.project-link:hover {
  color: var(--primary-light);
  transform: translateX(3px);
}

/* Section Styling */
.section {
  margin-bottom: 4rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

h1::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  bottom: -10px;
  left: 0;
  border-radius: 4px;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

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

a:hover {
  color: var(--primary-light);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.filter-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-button:hover, .filter-button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Footer */
.footer {
  background: var(--surface);
  padding: 5rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: inline-block;
  color: var(--text);
  text-decoration: none;
}

.footer-logo span {
  background: linear-gradient(90deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}

.footer-text {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-column h4 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  color: var(--text);
}

.footer-column h4::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  bottom: -10px;
  left: 0;
  border-radius: 3px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer .social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer .social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface-light);
  color: var(--text);
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer .social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-link {
  font-size: 1.5rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.social-link:hover {
  color: var(--primary);
  transform: translateY(-3px);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hero {
    min-height: 40vh; /* Adjust height for mobile if needed */
    /* Ensure flex centering is maintained or explicitly set */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-content {
    /* Ensure content takes appropriate width and is centered */
    max-width: 90%; /* Prevent text from touching edges */
    padding: 1rem; /* Adjust padding for mobile */
  }

  .hero-title {
    font-size: 2rem; /* Adjust font size for mobile */
  }

  .hero-subtitle {
    font-size: 1rem; /* Adjust font size for mobile */
  }

  nav ul {
    flex-wrap: wrap;
    padding: 0 1rem;
    gap: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  main {
    padding: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .filters {
    justify-content: center;
  }
}