*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --accent: #06d6a0;
  --accent-dark: #05b384;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-light: #f8fafc;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #e2e8f0;
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #06d6a0 100%);
  --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 214, 160, 0.05) 100%);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive Utilities */
.grid-resp {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.flex-stack-mobile {
    display: flex;
    gap: 1rem;
}

@media (max-width: 600px) {
    .grid-resp {
        grid-template-columns: 1fr;
    }
    .flex-stack-mobile {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  }

  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Icon Utilities */
.icon-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.05);
  color: var(--primary);
  flex-shrink: 0;
  transition: var(--transition);
}

.icon-round:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  transform: scale(1.05);
}

/* Buttons */
.btnPrimary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--gradient-accent);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-full);
    border: none;
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
}

.btnPrimary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btnOutline {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
}

.btnOutline:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.icon-sm {
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu-desktop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu-mobile {
    display: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.signup-btn {
    padding: 0.6rem 1.5rem;
    background: var(--gradient-accent);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    border: none;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.signup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* User Menu */
.user-menu {
    position: relative;
    margin-left: 0.5rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.user-menu:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.logout-link {
    color: #fca5a5 !important;
    margin-top: 0.25rem;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.orb1,
.orb2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.orb1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.orb2 {
    width: 300px;
    height: 300px;
    background: #06d6a0;
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* Category Grid */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Close Menu Button */
.close-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    transition: var(--transition);
}

.close-menu:hover {
    color: var(--text-primary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Trigger (Avatar or Hamburger) */
.mobile-trigger {
    display: none;
    cursor: pointer;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.mobile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.mobile-avatar.initials {
    background: var(--gradient-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .mobile-trigger {
        display: flex;
    }
    .nav-menu-desktop {
        display: none;
    }
}

/* Featured Freelancers */
.featured-section {
    padding: 5rem 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.freelancer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.freelancer-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.freelancer-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.freelancer-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.freelancer-info .role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.freelancer-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.rate {
    font-weight: 700;
    color: var(--accent);
}

.view-profile {
    font-size: 0.9rem;
    color: var(--primary-light);
    font-weight: 500;
    text-decoration: none;
}

.view-profile:hover {
    text-decoration: underline;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999; /* Just below menu drawer */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu-desktop {
        display: none;
    }

    .nav-menu-mobile {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        background-color: #020617 !important; /* Forces solid background */
        opacity: 1 !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 1.25rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2147483647; /* Maximum z-index possible to ensure it's on top */
        box-shadow: -15px 0 50px rgba(0, 0, 0, 0.8), -5px 0 15px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--border);
        display: flex;
    }
    
    .nav-menu-mobile.active {
        transform: translateX(0);
    }
    
    .mobile-menu-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 1.15rem;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .signup-btn {
        margin-top: 1rem;
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    .user-menu {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: none;
        border: none;
        padding: 0;
        width: 100%;
        margin-top: 1rem;
    }
    
    .close-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        color: white !important;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        width: 36px;
        height: 36px;
    }
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out both;
}

.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.cat-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.cat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Home Page Jobs */
.jobs-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.job-card-home {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.job-card-home:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.job-tag-home {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
}

.job-rate-home {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.15rem;
}

.job-title-home {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.job-desc-home {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.job-footer-home {
    display: flex;
    gap: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.job-meta-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.job-meta-home i {
    width: 16px;
    height: 16px;
}

/* How It Works */
.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

.step {
    flex: 1;
    max-width: 300px;
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: white;
    margin: 0 auto 1.25rem;
}

.step-connector {
    width: 80px;
    height: 2px;
    background: var(--border);
    margin-top: 4rem;
    flex-shrink: 0;
}

/* Footer */
footer {
    background: var(--bg-darker);
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo img {
    height: 32px;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Bottom Menu */
.bottomMenu {
    display: none;
}

@media (max-width: 768px) {
    .bottomMenu {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-darker);
        border-top: 1px solid var(--border);
        padding: 0.5rem 0;
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    }

    .bottomMenu .menuItem {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.75rem;
        gap: 0.35rem;
        transition: var(--transition);
        padding: 0.5rem 0;
        flex: 1;
    }

    .bottomMenu .menuItem i {
        width: 22px;
        height: 22px;
        display: block;
        margin: 0 auto;
    }

    .bottomMenu .menuItem.active,
    .bottomMenu .menuItem:hover {
        color: var(--primary-light);
    }

    main {
        padding-bottom: 70px; /* Add space for bottom menu */
    }
}