/* ============================================
   ZTOI TECH Portfolio - Stylesheet
   Matching main website design language
   ============================================ */

/* Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Color Variables */
:root {
    --primary: #FF4D00;
    --primary-hover: #e64500;
    --primary-light: rgba(255, 77, 0, 0.08);
    --primary-glow: rgba(255, 77, 0, 0.15);
    
    --black: #1a1a1a;
    --dark: #2d2d2d;
    --gray-700: #4a4a4a;
    --gray-600: #6b6b6b;
    --gray-500: #8c8c8c;
    --gray-400: #ababab;
    --gray-300: #d4d4d4;
    --gray-200: #e8e8e8;
    --gray-100: #f5f5f5;
    --cream: #faf9f6;
    --white: #ffffff;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-600);
    background-color: var(--cream);
    overflow-x: hidden;
}

::selection {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   Navigation
   ============================================ */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 77, 0, 0.1);
    transition: var(--transition-normal);
}

.nav-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-logo span {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-normal);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
}

.nav-cta {
    padding: 12px 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(255, 77, 0, 0.25);
    transition: var(--transition-normal);
}

.nav-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 77, 0, 0.35);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition-normal);
}

.nav-toggle:hover {
    background: var(--gray-100);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--black);
    margin: 5px 0;
    border-radius: 2px;
    transition: var(--transition-normal);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 120px 2rem 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 77, 0, 0.06) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 77, 0, 0.3));
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--black);
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-button {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-normal);
    box-shadow: 0 4px 16px rgba(255, 77, 0, 0.25);
}

.cta-button:hover {
    transform: translateY(-3px);
    background: var(--black);
    color: var(--primary);
    box-shadow: 0 8px 32px rgba(255, 77, 0, 0.35);
}

/* ============================================
   Category Navigation (Sticky)
   ============================================ */
.category-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 77, 0, 0.1);
    display: none;
    transition: var(--transition-normal);
}

.category-nav.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.back-to-site {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.back-to-site:hover {
    background: var(--primary-light);
}

.back-to-site i {
    font-size: 0.85rem;
}

.category-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1400px;
}

.category-link {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition-normal);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.category-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   Category Sections
   ============================================ */
.category-section {
    padding: 80px 2rem;
    max-width: 1400px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.category-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary);
    display: inline-block;
    position: relative;
}

.category-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.category-header p {
    color: var(--gray-500);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* ============================================
   Projects Grid
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    border: 1px solid var(--gray-200);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(255, 77, 0, 0.12);
}

.project-card.hidden {
    display: none;
}

.project-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
  position: absolute;
  top: 0;
  left: 0;
  }

/* Lazy Loading Styles */
.project-image img.lazy-loaded {
  opacity: 0;
  transform: scale(1.05);
}

.project-image img.lazy-loaded.loaded {
  opacity: 1;
  transform: scale(1);
}

.image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  transition: opacity 0.3s ease;
  z-index: 1;
}

.image-placeholder.error {
  background: var(--gray-100);
}

.image-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}

.image-loader i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition-normal);
}

.image-overlay i {
    color: var(--white);
    font-size: 2rem;
}

.image-overlay .image-count {
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.project-image:hover .image-overlay {
    opacity: 1;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.project-description {
    color: var(--gray-500);
    margin-bottom: 1rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tech-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 77, 0, 0.15);
}

.project-links {
    display: flex;
    gap: 0.75rem;
}

.project-link {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-normal);
    border: 2px solid var(--primary);
}

.project-link:hover {
    background: var(--primary);
    color: var(--white);
}

.view-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 14px 32px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-normal);
}

.view-more-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 77, 0, 0.25);
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* ============================================
   Gallery Modal
   ============================================ */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.gallery-modal.active {
    background-color: rgba(0, 0, 0, 0.95);
}

.gallery-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.gallery-modal.active .gallery-content {
    opacity: 1;
    transform: scale(1);
}

.gallery-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 77, 0, 0.2);
    transition: opacity 0.15s ease;
}

.gallery-image.transitioning {
    opacity: 0.3;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--primary);
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition-normal);
    line-height: 1;
}

.gallery-close:hover {
    color: var(--white);
    transform: rotate(90deg);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 50px;
    cursor: pointer;
    padding: 10px;
    user-select: none;
    z-index: 2001;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition-normal);
}

.gallery-nav:hover {
    background: var(--primary);
    color: var(--white);
}

.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }

.gallery-counter {
    margin-top: 1.5rem;
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 2px;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    padding: 80px 2rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--gray-100) 100%);
    text-align: center;
}

.contact-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-header p {
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.contact-info p {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-normal);
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(255, 77, 0, 0.25);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--black);
    color: var(--gray-400);
    padding: 2rem;
    text-align: center;
}

.footer p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   WhatsApp Button
   ============================================ */
.whatsapp-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 6px 24px rgba(255, 77, 0, 0.35);
    z-index: 997;
    transition: var(--transition-normal);
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 10px 32px rgba(255, 77, 0, 0.45);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-header { padding: 0.8rem 1rem; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 2rem 2rem;
        gap: 0;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: var(--transition-normal);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .nav-cta {
        margin-top: 1rem;
        width: 100%;
        text-align: center;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .category-nav { 
        padding: 0.8rem 1rem; 
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .category-nav.visible {
        flex-direction: column;
    }
    
    .back-to-site {
        align-self: flex-start;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .category-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
    }
    
    .category-links::-webkit-scrollbar { display: none; }
    
    .category-link {
        white-space: nowrap;
        font-size: 0.85rem;
        background: var(--gray-100);
        padding: 0.5rem 1rem;
    }
    
    .hero { padding: 100px 1rem 60px; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .logo-container { width: 80px; height: 80px; margin-bottom: 1.5rem; }

    .category-section { padding: 60px 1rem; }
    .category-header h2 { font-size: 1.8rem; }
    
    .projects-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .project-image { height: 220px; }
    
    .cta-button { 
        width: 100%; 
        max-width: 300px; 
        padding: 14px; 
        font-size: 0.9rem; 
    }

    .gallery-nav { width: 44px; height: 44px; font-size: 28px; }
    .gallery-prev { left: 10px; }
    .gallery-next { right: 10px; }
    .gallery-close { font-size: 36px; top: 15px; right: 20px; }
    
    .whatsapp-btn {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .category-header h2 { font-size: 1.5rem; }
    .project-title { font-size: 1.2rem; }
    .contact-header h2 { font-size: 1.8rem; }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 1s ease forwards 0.3s;
    opacity: 0;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
