/* Global Styles */
:root {
    --primary-color: #377b7c;
    --primary-dark: #2d6b6c;
    --primary-light: #5aa9aa;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --dark-color: #1F2937;
    --gray-color: #6B7280;
    --light-color: #F3F4F6;
    --white-color: #FFFFFF;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    --box-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #FAFAFA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    position: relative;
    padding: 8px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--dark-color);
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--light-color);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 2000; /* keep header above all page content */
    border-bottom: 1px solid #eef0f3;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* create stacking context for children */
    padding: 0.75rem 0 0.75rem 20px; /* remove right padding so actions can sit flush */
    min-height: 69px;
}

/* Hide mobile-only UI by default (desktop). They are enabled via mobile.css media queries */
.mobile-controls,
.mobile-menu-trigger,
.mobile-backdrop,
.mobile-sidebar,
.mobile-only { display: none; }

/* Make navbar container edge-to-edge */
.navbar .container {
    max-width: 100%;
    padding: 0.75rem 16px; /* keep vertical spacing, add small horizontal gutter */
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    flex: 0 0 auto;
}

.nav-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 2; /* ensure menu links stay clickable */
    flex: 1; /* take available space to push actions to the far right */
    pointer-events: auto;
    margin-left: 56px; /* moved 30px further right */
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 3; /* ensure actions (cart/user) are above anything */
    margin-left: auto; /* push actions group to the extreme right */
    flex: 0 0 auto;
    pointer-events: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* Cart icon button */
.btn-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--dark-color);
    background: transparent;
    transition: var(--transition);
}

.btn-icon:hover {
    background: transparent;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: var(--light-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-user:hover {
    background-color: #E5E7EB;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    z-index: 5; /* above header items but within header stacking */
    border: 1px solid #e1e5e9;
    pointer-events: auto;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--dark-color);
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
}

.dropdown-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e1e5e9;
}

/* Wishlist heart visual state */
.btn-wishlist { color: #374151; }
.btn-wishlist i { transition: color 0.2s ease; text-shadow: 0 0 2px rgba(255,255,255,0.9); }
.btn-wishlist.active i { color: var(--danger-color); text-shadow: 0 0 2px rgba(255,255,255,0.9); }
/* YITH-like bounce animation for heart */
.yith-bounce { animation: yithHeart 0.3s ease-in-out; }
@keyframes yithHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.dropdown-header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 8px;
}

.dropdown-header span {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* Price display on project cards */
.project-price { display:flex; align-items:baseline; gap:8px; }
.project-price .price-old { text-decoration: line-through; color:#9ca3af; font-weight:600; }
.project-price .price-current { color: var(--primary-color); font-weight:800; }

/* Hero Section */
.hero {
    background: transparent; /* remove gradient background */
    color: var(--primary-color); /* use theme color for text */
    padding: 48px 0; /* reduced height */
    position: relative;
    overflow: hidden;
}

.hero::before { content: none; }

/* Shared page hero styling for internal pages */
.browse-header,
.categories-header,
.about-hero,
.contact-hero,
.profile-header {
    background: transparent; /* remove gradient */
    color: var(--primary-color); /* theme color text */
    padding: 40px 0; /* reduced height for internal heroes */
    position: relative;
    overflow: hidden;
    text-align: center;
}

.browse-header::before,
.categories-header::before,
.about-hero::before,
.contact-hero::before,
.profile-header::before { content: none; }

.browse-header .container,
.categories-header .container,
.about-hero .container,
.contact-hero .container,
.profile-header .container {
    position: relative;
    z-index: 1;
}

.browse-header h1,
.categories-header h1,
.about-hero h1,
.contact-hero h1,
.profile-header h1,
.browse-header p,
.categories-header p,
.about-hero p,
.contact-hero p,
.profile-header p {
    color: var(--primary-color);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Make hero container full-width with small gutter */
.hero .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

/* Redesigned minimal Browse Projects button */
.btn-browse {
    background: transparent;
    color: var(--dark-color);
    border: 1px solid #e1e5e9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.btn-browse i { display: none; }
.btn-browse:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Search Box */
.search-box {
    max-width: 800px;
    margin: 0 auto 3rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.search-input-group {
    display: flex;
    background-color: white;
    border-radius: 50px;
    padding: 8px;
    box-shadow: var(--box-shadow-lg);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-select {
    padding: 12px 20px;
    border: none;
    outline: none;
    background-color: transparent;
    color: var(--gray-color);
    cursor: pointer;
}

.btn-search {
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-item i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Sections */
.section {
    padding: 60px 0;
}

.section .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-color);
}

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

.project-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.project-card.featured {
    border: 2px solid var(--primary-color);
}

/* Desktop: match Featured card border to regular cards (no colored border) */
@media (min-width: 769px) {
  .featured-projects .project-card.featured { border: none; }
  /* Reduce thumbnail height for regular (non-featured) cards on desktop */
  .project-card:not(.featured) .project-thumbnail { height: 144px; }
  /* Add divider under each All Projects card for separation */
  .all-projects .project-card.small { border-bottom: 1px solid #e5e7eb; }
  /* All Projects: tighter layout and spacing */
  .all-projects .recent-grid { gap: 0.5rem; }
  .all-projects .project-card.small .project-content { padding: 0.75rem; }
  .all-projects .project-card.small .project-footer { padding-top: 0.25rem; }
  .all-projects .project-card.small .project-title,
  .all-projects .project-card.small .project-name { margin-bottom: 0.25rem; }
}

.project-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--warning-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.project-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(55, 123, 124, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.project-category {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project-title,
.project-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-title a,
.project-name a {
    color: var(--dark-color);
    text-decoration: none;
}

.project-title a:hover,
.project-name a:hover {
    color: var(--dark-color);
    text-decoration: none;
}

.project-description {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--gray-color);
}

.project-stats span {
    margin-left: 10px;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--light-color);
    margin-top: auto;
}

.project-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-old {
    text-decoration: line-through;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
}

.category-name {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.category-description {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Make features section container full-width and edge-to-edge */
.features .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
    line-height: 1.6;
}

/* Footer */
.footer {
    background-color: #ffffff;
    color: var(--dark-color);
    padding: 1.5rem 0 10px; /* add 10px bottom padding */
    margin-top: auto; /* push footer to bottom on short pages */
    border-top: 1px solid #e5e7eb; /* subtle top border only */
}

/* Make footer container edge-to-edge */
.footer .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem; /* tighter column gap */
    margin-bottom: 15px; /* 15px gap before footer-bottom */
}

.footer-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section p {
    color: #9CA3AF;
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

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

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

.footer-links a {
    color: #4B5563;
    transition: var(--transition);
}

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

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    background-color: #f3f4f6;
    color: var(--dark-color);
}

.newsletter-form input::placeholder {
    color: #9CA3AF;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px; /* 15px gap */
    border-top: 0; /* keep underline removed */
    color: #9CA3AF;
    position: relative; /* for positioning the arrow */
    padding-right: 60px; /* reserve space for arrow on the right */
}

.footer-bottom i {
    color: var(--danger-color);
}

/* Hide mobile-only social block on desktop */
.footer .social-mobile { display: none !important; }

/* Footer bottom layout and scroll-to-top button styling */
@media (min-width: 769px) {
  .footer-bottom { display: block; }
}

.scroll-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  color: var(--dark-color);
  border: 1px solid rgba(0,0,0,0.08);
  transition: background 0.2s ease, transform 0.2s ease;
  position: absolute; /* place at far right edge */
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.scroll-top-btn:hover { background: rgba(0,0,0,0.08); transform: translateY(calc(-50% - 2px)); }
.scroll-top-btn i { font-size: 16px; line-height: 1; }

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