/**
 * home.css - Core styles for shared components (header, modal, mobile menu)
 * This file provides the .active state rules that the JavaScript in scripts.php depends on
 */

/* ========================================
   Mobile Menu Active States
   ======================================== */
#mobile-menu {
    max-width: 100%;
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

#mobile-menu.active {
    transform: translateX(0) !important;
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s linear 0s;
}

#mobile-menu-overlay.active {
    display: block !important;
    opacity: 1 !important;
}

/* Small phones: make the drawer full-width so nothing is cut off */
@media (max-width: 360px) {
    #mobile-menu {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   Modal Active States
   ======================================== */
/* Hide by default (overrides any Tailwind flex utilities on the element) */
#quote-modal {
    display: none;
}
/* Show when JS adds .active */
#quote-modal.active {
    display: flex !important;
}

/* ========================================
   Header Scroll Effect
   ======================================== */
#header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
}

/* ========================================
   Smooth Scroll Behavior
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* Ensure anchored sections aren't hidden behind the fixed header
   (no-JS fallback for anchor navigation) */
section[id] {
    scroll-margin-top: 5rem;
}

/* ========================================
   Navbar Active State Styles
   ======================================== */
.nav-link.active {
    color: #22B8D1 !important;
    background-color: #E4F5FA !important;
}

.mobile-nav-link.active {
    color: #22B8D1 !important;
    background-color: #E4F5FA !important;
}

/* ========================================
   Focus Visible for Accessibility
   ======================================== */
:focus-visible {
    outline: 2px solid #22B8D1;
    outline-offset: 2px;
}

/* ========================================
   Animation Classes (referenced in components)
   ======================================== */
.animate-fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Hero Section Overlay Gradient (referenced in hero.php)
   ======================================== */
.hero-slide {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ========================================
   Utility Classes
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #22B8D1;
    color: white;
    font-weight: 500;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

/* ========================================
   Portfolio Section Styles
   ======================================== */

/* Portfolio Card Animations */
@keyframes portfolioFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item {
    animation: portfolioFadeInUp 0.5s ease forwards;
}

.portfolio-filter-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

.portfolio-filter-btn:focus {
    outline: 2px solid #22B8D1;
    outline-offset: 2px;
}

/* Portfolio Grid Cards */
.portfolio-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.portfolio-card .portfolio-card-image {
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-card-image {
    transform: scale(1.05);
}

/* Featured Badge */
.portfolio-featured-badge {
    background: #f59e0b;
    color: white;
    animation: portfolioPulse 2s infinite;
}

@keyframes portfolioPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.75;
    }
}

/* Technology Tags */
.portfolio-tech-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #E4F5FA;
    color: #256E7A;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.125rem;
    white-space: nowrap;
}

.portfolio-tech-tag-overlay {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    margin: 0.125rem;
    white-space: nowrap;
}

/* Portfolio Detail - Project Meta */
.portfolio-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-meta-item:last-child {
    border-bottom: none;
}

.portfolio-meta-icon {
    width: 40px;
    height: 40px;
    background: #E4F5FA;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #256E7A;
    flex-shrink: 0;
}

.portfolio-meta-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.portfolio-meta-value {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.9375rem;
}

/* Gallery Lightbox */
.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.portfolio-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.portfolio-lightbox .close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.portfolio-lightbox .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.portfolio-lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.portfolio-lightbox .nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.portfolio-lightbox .nav-btn.prev {
    left: 2rem;
}

.portfolio-lightbox .nav-btn.next {
    right: 2rem;
}

.portfolio-lightbox .counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
}

/* Portfolio Detail - Prose Content */
.portfolio-prose {
    color: #374151;
    line-height: 1.8;
    max-width: none;
}

.portfolio-prose h2 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.portfolio-prose h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.portfolio-prose p {
    margin-bottom: 1rem;
}

.portfolio-prose ul,
.portfolio-prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.portfolio-prose li {
    margin-bottom: 0.5rem;
}

.portfolio-prose strong {
    font-weight: 600;
}

.portfolio-prose code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.portfolio-prose pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.portfolio-prose pre code {
    background: transparent;
    padding: 0;
}

.portfolio-prose a {
    color: #22B8D1;
    text-decoration: underline;
}

.portfolio-prose blockquote {
    border-left: 4px solid #22B8D1;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
}

/* Portfolio Detail - Related Projects */
.related-project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Portfolio Detail - Prev/Next */
.portfolio-prev-next {
    transition: all 0.3s ease;
}

.portfolio-prev-next:hover {
    background: rgba(228, 245, 250, 0.5);
    transform: translateY(-2px);
}

/* Portfolio Listing - Filter Buttons */
.portfolio-filter-btn-listing {
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.portfolio-filter-btn-listing.active {
    background: #22B8D1;
    color: white;
    border-color: #22B8D1;
    box-shadow: 0 4px 12px rgba(34, 184, 209, 0.3);
}

.portfolio-filter-btn-listing.active:hover {
    background: #22B8D1;
    color: white;
}

/* Portfolio Listing - Stat Cards */
.portfolio-stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.portfolio-stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.portfolio-stat-card .stat-value {
    color: white;
}

.portfolio-stat-card .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Portfolio Listing - Search Input */
.portfolio-search-input:focus {
    box-shadow: 0 0 0 3px rgba(34, 184, 209, 0.3);
    border-color: transparent;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .portfolio-item,
    .portfolio-featured-badge,
    .portfolio-card,
    .related-project-card,
    .portfolio-prev-next {
        animation: none !important;
        transition: none !important;
    }
}

/* Responsive Lightbox */
@media (max-width: 768px) {
    .portfolio-lightbox .nav-btn {
        width: 44px;
        height: 44px;
    }

    .portfolio-lightbox .nav-btn.prev {
        left: 1rem;
    }

    .portfolio-lightbox .nav-btn.next {
        right: 1rem;
    }

    .portfolio-lightbox .close-btn {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {

    #header,
    #mobile-menu,
    #mobile-menu-overlay,
    #quote-modal,
    .floating-buttons,
    #scroll-top {
        display: none !important;
    }

    body {
        overflow: visible !important;
    }
}