/* Scoped Styles for Nova Portfolio */

.jcportfolio-project-wrapper {
    position: relative;
    background-color: var(--secondary, #05020a);
    color: #e2e8f0;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    width: 100%;
}

/* Editor Guard */
.jcportfolio-project-wrapper.jc-is-editor {
    cursor: default !important;
    overflow: visible;
    /* Allow editing handles to be seen */
}

/* Ensure overlays don't block clicks in editor */
.jcportfolio-project-wrapper.jc-is-editor .jcportfolio-noise-overlay,
.jcportfolio-project-wrapper.jc-is-editor .jcportfolio-grid-bg,
.jcportfolio-project-wrapper.jc-is-editor .jcportfolio-starfield {
    pointer-events: none;
    z-index: 0;
}

/* --- Typography --- */
.jcportfolio-project-wrapper h1,
.jcportfolio-project-wrapper h2,
.jcportfolio-project-wrapper h3,
.jcportfolio-project-wrapper .font-display {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.05em;
    margin: 0;
}

/* --- Gradient Text --- */
.jcportfolio-text-gradient-primary {
    background: linear-gradient(135deg, var(--primary, #A234FD) 0%, #d8b4fe 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- 1. Custom Cursor --- */
.jcportfolio-custom-cursor {
    position: fixed;
    /* Keep fixed to follow mouse viewport */
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid var(--primary, #A234FD);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    /* Transformation handled by JS to avoid layout thrashing */
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: screen;
}

.jcportfolio-custom-cursor.hovered {
    width: 50px;
    height: 50px;
    background: rgba(162, 52, 253, 0.1);
}

.jcportfolio-custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: var(--primary, #A234FD);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
}

/* Hide cursor in editor */
body.elementor-editor-active .jcportfolio-custom-cursor,
body.elementor-editor-active .jcportfolio-custom-cursor-dot {
    display: none !important;
}

/* --- 2. Background Layers --- */
.jcportfolio-starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.jcportfolio-noise-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.jcportfolio-grid-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(162, 52, 253, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(162, 52, 253, 0.05) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

/* --- 3. Hero Section --- */
.jcportfolio-hero {
    position: relative;
    padding: 100px 20px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jcportfolio-hero-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    z-index: 10;
}

@media (min-width: 992px) {
    .jcportfolio-hero-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Hero Content */
.jcportfolio-hero-content {
    text-align: left;
}

.jcportfolio-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(162, 52, 253, 0.3);
    border-radius: 999px;
    background: rgba(37, 17, 55, 0.5);
    backdrop-filter: blur(4px);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary, #A234FD);
    margin-bottom: 24px;
}

.jcportfolio-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary, #A234FD);
}

.jcportfolio-hero-title {
    font-size: 48px;
    line-height: 1;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .jcportfolio-hero-title {
        font-size: 72px;
    }
}

.jcportfolio-hero-desc {
    font-size: 18px;
    line-height: 1.6;
    color: #94a3b8;
    border-left: 2px solid rgba(162, 52, 253, 0.3);
    padding-left: 24px;
    max-width: 500px;
}

/* Hero Visual (Planet) */
.jcportfolio-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.jcportfolio-planet-glow {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--primary, #A234FD), #1a0b2e);
    box-shadow: 0 0 60px rgba(162, 52, 253, 0.3), inset -10px -10px 20px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
}

.jcportfolio-planet-ring-system {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 100px;
    border: 1px solid rgba(162, 52, 253, 0.2);
    border-left: 1px solid rgba(162, 52, 253, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    z-index: 1;
    animation: jc-spin 20s linear infinite;
}

@keyframes jc-spin {
    from {
        transform: translate(-50%, -50%) rotate(-15deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(345deg);
    }
}

/* --- 4. Gallery Grid (Visual Archives) --- */
.jcportfolio-gallery-section {
    position: relative;
    padding: 80px 20px;
    z-index: 10;
}

.jcportfolio-container {
    max-width: 1200px;
    margin: 0 auto;
}

.jcportfolio-masonry-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 24px;
}

@media (min-width: 600px) {
    .jcportfolio-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet */
    }
}

@media (min-width: 900px) {
    .jcportfolio-masonry-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Desktop */
    }
}

/* Portfolio Card */
.jcportfolio-masonry-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(37, 17, 55, 0.4);
    border: 1px solid rgba(162, 52, 253, 0.1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: none;
}

/* Disable hover effects in editor to make clicking easier */
.jcportfolio-project-wrapper:not(.jc-is-editor) .jcportfolio-masonry-item:hover {
    transform: translateY(-5px);
    border-color: rgba(162, 52, 253, 0.5);
}

.jcportfolio-project-wrapper.jc-is-editor .jcportfolio-masonry-item {
    cursor: default;
}

.jcportfolio-masonry-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    aspect-ratio: 4/5;
}

.jcportfolio-masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    filter: grayscale(20%);
}

.jcportfolio-project-wrapper:not(.jc-is-editor) .jcportfolio-masonry-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* Overlay */
.jcportfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 2, 10, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.jcportfolio-masonry-item:hover .jcportfolio-overlay {
    opacity: 1;
}

.jcportfolio-overlay span {
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 10px 20px;
    border: 1px solid var(--primary, #A234FD);
    background: rgba(37, 17, 55, 0.8);
    backdrop-filter: blur(4px);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.jcportfolio-masonry-item:hover .jcportfolio-overlay span {
    transform: translateY(0);
}

/* --- 5. Lightbox --- */
.jcportfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.jcportfolio-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.jcportfolio-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 2, 10, 0.95);
    backdrop-filter: blur(5px);
}

.jcportfolio-lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
    max-height: 90vh;
}

.jcportfolio-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    box-shadow: 0 0 50px rgba(162, 52, 253, 0.2);
    border: 1px solid rgba(162, 52, 253, 0.3);
}

.jcportfolio-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
}

.jcportfolio-lightbox-close:hover {
    color: var(--primary, #A234FD);
}

.jcportfolio-lightbox-prev,
.jcportfolio-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.jcportfolio-lightbox-prev:hover,
.jcportfolio-lightbox-next:hover {
    background: var(--primary, #A234FD);
    color: #fff;
}

.jcportfolio-lightbox-prev {
    left: -80px;
}

.jcportfolio-lightbox-next {
    right: -80px;
}

@media (max-width: 768px) {
    .jcportfolio-lightbox-prev {
        left: 10px;
    }

    .jcportfolio-lightbox-next {
        right: 10px;
    }
}

/* --- HUD Elements --- */
.jcportfolio-wrapper-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.jcportfolio-hud-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(162, 52, 253, 0.3);
}

.jcportfolio-hud-tl {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.jcportfolio-hud-tr {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
}

.jcportfolio-hud-bl {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.jcportfolio-hud-br {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

.jcportfolio-live-clock {
    position: absolute;
    top: 30px;
    right: 40px;
    font-family: 'Orbitron', sans-serif;
    color: rgba(162, 52, 253, 0.7);
    font-size: 12px;
    letter-spacing: 0.1em;
}