/* SubPage.CSS - Specific styles for individual project pages */

/* -- Minimal Back Nav -- */
#back-nav {
    position: fixed;
    top: 2rem;
    left: 2rem;
    padding: 10px 20px;
    z-index: 100;
    transition: var(--transition-smooth);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

#back-nav:hover {
    border-color: rgba(112, 0, 255, 0.4);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.2);
}

.back-link:hover {
    color: var(--color-accent-secondary);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* -- Hero Section -- */
.project-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* Adds a gradient fade to the bottom so it blends into the deep background */
.hero-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(5, 5, 7, 0.1) 0%, rgba(5, 5, 7, 0.8) 80%, var(--color-bg-deep) 100%);
    z-index: 1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    padding: 2.5rem 4rem;
    margin-bottom: -3.5rem;
    /* overlap with content below */
    text-align: center;
    width: 80%;
    max-width: 900px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.project-title {
    font-size: var(--font-size-h2);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.project-tagline {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* -- Project Details Main Area -- */
#project-details {
    padding-top: 6rem;
    /* space for overlapping header */
    max-width: 1200px;
    margin: 0 auto;
    min-height: auto;
}

.project-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Left Column */
.info-section {
    margin-bottom: 3.5rem;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.info-section:nth-child(1) {
    animation-delay: 0.1s;
}

.info-section:nth-child(2) {
    animation-delay: 0.2s;
}

.info-section:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-subtitle {
    font-size: var(--font-size-h3);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.info-section p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-list li::before {
    content: '►';
    color: var(--color-accent-secondary);
    font-size: 0.8rem;
    text-shadow: 0 0 5px var(--color-accent-secondary);
}

.feature-list li:last-child {
    border-bottom: none;
}

/* Gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.gallery-img:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.2);
    z-index: 10;
    position: relative;
}

/* Right Column: Metadata */
.project-sidebar {
    position: sticky;
    top: 6rem;
    animation: fadeInRight 0.8s ease forwards;
    opacity: 0;
    transform: translateX(20px);
    animation-delay: 0.4s;
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.metadata-panel {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-title {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.meta-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    font-weight: 600;
}

.meta-value {
    color: #fff;
    font-weight: 400;
    font-size: 1.05rem;
}

.meta-tags {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-actions .cta-button {
    text-align: center;
    width: 100%;
}

.secondary-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-text-secondary);
    text-shadow: none;
    box-shadow: none;
}

.secondary-btn:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* -- Responsive -- */
@media (max-width: 992px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .project-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .project-hero {
        height: 50vh;
        min-height: 350px;
    }

    .hero-overlay {
        width: 100%;
        padding: 1.5rem;
        margin-bottom: -1rem;
    }

    #project-details {
        padding-top: 4rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    #back-nav {
        top: 1rem;
        left: 1rem;
        padding: 8px 15px;
    }
}

/* -- Source Code Side Panel -- */
.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    /* Hidden by default */
    width: 80%;
    height: 100vh;
    z-index: 1000;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.05);
    /* Smooth slide */
    overflow-y: auto;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

/* Panel Header (Sticky) */
.panel-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.95) 60%, transparent);
    z-index: 10;
    box-sizing: border-box;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 0, 85, 0.2);
    border-color: rgba(255, 0, 85, 0.5);
    color: #fff;
    transform: rotate(90deg);
}

.close-btn svg {
    width: 24px;
    height: 24px;
}

.github-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #24292e;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-btn:hover {
    background: #2b3137;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Panel Content */
.panel-content {
    padding: 2rem 4rem 4rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Feature Segments */
.feature-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.code-container {
    padding: 1.5rem;
    background: #1e1e1e;
    /* Classic editor dark background */
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.code-container pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    color: #d4d4d4;
    /* Typical code color */
    line-height: 1.5;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

@media (max-width: 1200px) {
    .feature-segment {
        grid-template-columns: 1fr;
        grid-template-rows: auto 300px;
    }

    .code-container {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 768px) {
    .side-panel {
        width: 100%;
    }

    .panel-content {
        padding: 2rem;
    }
}