/* Modern Theme CSS with Crystal Effect */

:root {
  --primary: #ffffff;
  --primary-dark: #e5e5e5;
  --secondary: #9ca3af;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --background: #0a0a0a;
  --background-dark: #000000;
  --background-light: #171717;
  --card-bg: rgba(23, 23, 23, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0,0,0,0.3);
  --transition: all 0.35s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  overflow-x: hidden;
}

/* Subtle grain overlay for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.25;
  mix-blend-mode: normal;
  z-index: 0;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.tech-title {
  color: var(--primary);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* Compact sections specifically on Works page */
body.works-page .section {
  padding: 3.5rem 0;
}

.section-dark {
  background: var(--background-dark);
}

.section-light {
  background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  background: transparent;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: var(--background-dark);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

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

.navbar-brand i {
  color: var(--primary);
  font-size: 1.8rem;
}

.navbar-brand img {
  height: 36px;
  width: auto;
  display: inline-block;
  filter: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.navbar-nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
  .navbar-container {
    padding: 0.5rem 1rem;
  }

  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-dark);
    backdrop-filter: blur(10px);
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-item {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block;
    padding: 0.8rem 0;
  }

  .nav-item:last-child {
    margin-top: 0.5rem;
  }

  .nav-item .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn i { opacity: 0.9; }

.btn-primary {
  background: var(--primary);
  color: var(--background-dark);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--background-dark);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--background-dark);
  transform: translateY(-2px) scale(1.01);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.hero-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(var(--background-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--background-dark) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center center;
  opacity: 0.1;
  transform: perspective(1000px) rotateX(60deg);
}

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

.hero-title {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: glow 3s ease-in-out infinite alternate;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Cards */
.crystal-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.crystal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  transform: translateX(-100%);
  transition: var(--transition);
}

.crystal-card:hover::before {
  transform: translateX(100%);
}

.crystal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.35);
}

.portfolio-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.portfolio-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
  will-change: transform, box-shadow;
  animation: cardIn 0.6s ease both;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.45);
  border-color: rgba(255, 255, 255, 0.22);
}

.portfolio-image {
  background: var(--background-light);
  padding: 0.5rem;
}

.portfolio-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.portfolio-content {
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.03);
}

.portfolio-content h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.portfolio-content p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.portfolio-content .btn {
  width: auto;
  justify-content: center;
  padding: 0.55rem 0.9rem;
}

.portfolio-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
}

/* Portfolio Filter (Types of Work) */
.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.portfolio-filter .btn.active {
  background: var(--primary);
  color: var(--background-dark);
  border-color: var(--primary);
}

.hero .portfolio-filter {
  margin-top: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

/* Keep hero filter buttons on one line on desktop */
@media (min-width: 992px) {
  .hero .portfolio-filter {
    flex-wrap: nowrap;
  }
}

.portfolio-filter .btn {
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  max-width: 800px;
  width: 92%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--background-light);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.project-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* Works page: enforce 3 columns on desktop, 2 on tablet, 1 on mobile */
body.works-page .portfolio-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  body.works-page .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body.works-page .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Subtle stagger for cards */
.portfolio-item:nth-child(1) { animation-delay: 0.03s; }
.portfolio-item:nth-child(2) { animation-delay: 0.06s; }
.portfolio-item:nth-child(3) { animation-delay: 0.09s; }
.portfolio-item:nth-child(4) { animation-delay: 0.12s; }
.portfolio-item:nth-child(5) { animation-delay: 0.15s; }
.portfolio-item:nth-child(6) { animation-delay: 0.18s; }
.portfolio-item:nth-child(7) { animation-delay: 0.21s; }
.portfolio-item:nth-child(8) { animation-delay: 0.24s; }
.portfolio-item:nth-child(9) { animation-delay: 0.27s; }
.portfolio-item:nth-child(10) { animation-delay: 0.30s; }
.portfolio-item:nth-child(11) { animation-delay: 0.33s; }
.portfolio-item:nth-child(12) { animation-delay: 0.36s; }

/* Service Icons */
.service-icon {
  width: 64px;
  height: 64px;
  background: var(--background-light);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--primary);
  transition: var(--transition);
}

.crystal-card:hover .service-icon {
  transform: scale(1.1);
  color: var(--background-dark);
  background: var(--primary);
}

/* Unified Icon Styles for better consistency site-wide */
.tech-icon,
.stat-icon,
.benefit-icon,
.result-icon {
  width: 64px;
  height: 64px;
  background: var(--background-light);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  color: var(--primary);
  transition: var(--transition);
}

.crystal-card:hover .tech-icon,
.crystal-card:hover .stat-icon,
.crystal-card:hover .benefit-icon,
.crystal-card:hover .result-icon {
  transform: scale(1.08);
  color: var(--background-dark);
  background: var(--primary);
}

/* Feature List */
.feature-list {
  list-style: none;
  margin-top: 1rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.feature-list li i {
  color: var(--primary);
}

/* Stats */
.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Contact Form Styles */
.contact-card {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form {
  margin-top: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  text-align: center;
  margin-top: 2rem;
}

.form-submit .btn {
  min-width: 200px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: var(--background-dark);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border);
}

.footer-section h4 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

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

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

.footer-links a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: none !important;
}

.whatsapp-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.45);
}

/* Animations */
@keyframes glow {
  0% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
  }
  100% {
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.35),
                 0 0 36px rgba(255, 255, 255, 0.25),
                 0 0 48px rgba(255, 255, 255, 0.15);
  }
}

.fade-up {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-dark);
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--border);
  }
  
  .navbar-nav.show {
    display: flex;
  }
  
  .navbar-toggle {
    display: block;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

/* Mobile Navigation Toggle */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  position: relative;
  cursor: pointer;
}

.toggle-icon,
.toggle-icon::before,
.toggle-icon::after {
  content: '';
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text);
  transition: var(--transition);
}

.toggle-icon {
  top: 50%;
  transform: translateY(-50%);
}

.toggle-icon::before {
  top: -8px;
}

.toggle-icon::after {
  bottom: -8px;
}

.navbar-toggle.active .toggle-icon {
  background: transparent;
}

.navbar-toggle.active .toggle-icon::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active .toggle-icon::after {
  transform: rotate(-45deg) translate(7px, -7px);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--background-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
