/**
 * InspiredByJason - Portfolio Page Styles
 * Gallery grid, hotspots, filtering, lightbox
 */

/* ============================================
   PORTFOLIO HERO
   ============================================ */

.portfolio-hero {
    padding-bottom: var(--space-8);
}

.portfolio-intro {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */

.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-12);
}

.filter-btn {
    padding: var(--space-2) var(--space-5);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   PORTFOLIO GALLERY
   ============================================ */

.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.portfolio-category {
    margin-bottom: var(--space-16);
}

.portfolio-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    max-width: 600px;
}

/* ============================================
   GALLERY ITEMS
   ============================================ */

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-accent);
}

.gallery-item-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(13, 27, 42, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-6);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-within .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.gallery-item-meta {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.gallery-item-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.gallery-item-link:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   HOTSPOT IMAGE CONTAINER
   ============================================ */

.hotspot-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hotspot-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   HOTSPOTS
   ============================================ */

.hotspot {
    position: absolute;
    z-index: 10;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.hotspot.visible {
    opacity: 1;
    transform: scale(1);
}

.hotspot-button {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hotspot-button::before {
    content: '+';
    color: var(--bg-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.hotspot-button:hover,
.hotspot.active .hotspot-button {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.5);
}

.hotspot-button:focus-visible {
    outline: 3px solid var(--text-primary);
    outline-offset: 2px;
}

/* Pulse animation */
.hotspot-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0;
    animation: hotspot-pulse 2s infinite;
}

@keyframes hotspot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.hotspot.active .hotspot-button::after,
.hotspot:hover .hotspot-button::after {
    animation: none;
    opacity: 0;
}

/* ============================================
   HOTSPOT TOOLTIPS
   ============================================ */

.hotspot-tooltip {
    position: absolute;
    width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base);
    z-index: 20;
}

.hotspot.active .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Tooltip positioning */
.hotspot-tooltip.position-right {
    left: calc(100% + 15px);
}

.hotspot-tooltip.position-left {
    right: calc(100% + 15px);
}

.hotspot-tooltip.position-top {
    bottom: calc(100% + 15px);
}

.hotspot-tooltip.position-bottom {
    top: calc(100% + 15px);
}

/* Tooltip arrow */
.hotspot-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.hotspot-tooltip.position-right::before {
    left: -7px;
    top: 50%;
    margin-top: -6px;
    border-right: none;
    border-top: none;
}

.hotspot-tooltip.position-left::before {
    right: -7px;
    top: 50%;
    margin-top: -6px;
    border-left: none;
    border-bottom: none;
}

/* Tooltip content */
.hotspot-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.hotspot-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

.hotspot-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--accent-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-base);
}

.hotspot-link:hover {
    color: var(--accent-highlight);
}

.hotspot-link::after {
    content: '\2192';
}

/* ============================================
   FEATURED PORTFOLIO ITEM
   ============================================ */

.portfolio-featured {
    grid-column: span 2;
}

.portfolio-featured .gallery-item-image {
    aspect-ratio: 16 / 9;
}

/* ============================================
   PORTFOLIO NAVIGATION
   ============================================ */

.portfolio-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-color);
}

.portfolio-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color var(--transition-base);
}

.portfolio-nav-link:hover {
    color: var(--accent-primary);
}

.portfolio-nav-link.prev::before {
    content: '\2190';
}

.portfolio-nav-link.next::after {
    content: '\2192';
}

/* ============================================
   RESPONSIVE - PORTFOLIO
   ============================================ */

@media (max-width: 1200px) {
    .portfolio-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-featured {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .portfolio-filters {
        gap: var(--space-2);
    }

    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-xs);
    }

    .portfolio-gallery {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .portfolio-featured {
        grid-column: span 1;
    }

    .portfolio-featured .gallery-item-image {
        aspect-ratio: 4 / 3;
    }

    /* Hotspot adjustments for mobile */
    .hotspot-button {
        width: 28px;
        height: 28px;
    }

    .hotspot-button::before {
        font-size: 16px;
    }

    .hotspot-tooltip {
        width: 240px;
        padding: var(--space-3);
    }

    /* Force tooltips to appear below on mobile */
    .hotspot-tooltip.position-left,
    .hotspot-tooltip.position-right {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(10px);
        top: calc(100% + 10px);
    }

    .hotspot.active .hotspot-tooltip.position-left,
    .hotspot.active .hotspot-tooltip.position-right {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(180deg, transparent 60%, rgba(13, 27, 42, 0.9) 100%);
    }

    .gallery-item-title {
        font-size: var(--font-size-base);
    }

    .hotspot-tooltip {
        width: calc(100vw - var(--space-8));
        max-width: 280px;
    }
}
