/* ============================================
   POLYTRA PROJECTS PAGE - Isolated Styles
   Matches Cinematic Dark Theme
   ============================================ */

/* === CSS Variables (matching main site) === */
:root {
    --proj-bg: #0a0a0a;
    --proj-surface: #141414;
    --proj-surface-2: #1a1a1a;
    --proj-surface-3: #111111;
    --proj-text: #ffffff;
    --proj-text-muted: rgba(255, 255, 255, 0.6);
    --proj-text-dim: rgba(255, 255, 255, 0.4);
    --proj-gold: #d4af37;
    --proj-gold-dark: #b8941f;
    --proj-border: rgba(255, 255, 255, 0.1);
    --proj-border-hover: rgba(212, 175, 55, 0.3);
    --proj-overlay: rgba(10, 10, 10, 0.85);
    --proj-font-body: 'Inter', sans-serif;
    --proj-font-heading: 'Playfair Display', serif;
    --proj-radius: 8px;
    --proj-transition: all 0.3s ease;
}

/* === Reset & Base === */
.proj-page-body,
body.cinematic-theme {
    font-family: var(--proj-font-body);
    background: var(--proj-bg);
    color: #ffffff;
    overflow-x: hidden;
}

/* Ensure all text is white by default */
body.cinematic-theme h1,
body.cinematic-theme h2,
body.cinematic-theme h3,
body.cinematic-theme h4,
body.cinematic-theme h5,
body.cinematic-theme h6,
body.cinematic-theme p,
body.cinematic-theme span,
body.cinematic-theme a,
body.cinematic-theme div {
    color: inherit;
}

/* === Navigation === */
.proj-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 60px;
    background: transparent;
    transition: all 0.4s ease;
}

.proj-nav.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    padding: 20px 60px;
}

.proj-nav-brand a { text-decoration: none; }
.proj-nav-logo { height: 100px; width: auto; object-fit: contain; }

.proj-nav-links {
    display: flex;
    gap: 35px;
}

.proj-nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

.proj-nav-links a:hover,
.proj-nav-links a.active {
    color: #ffffff;
}

.proj-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ffffff;
}

.proj-nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.proj-admin-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.proj-admin-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.proj-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--proj-text);
    font-size: 1.3rem;
    cursor: pointer;
}

/* Mobile Menu */
.proj-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.proj-mobile-menu.open { display: flex; }

.proj-mobile-menu a {
    color: var(--proj-text);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--proj-transition);
}
.proj-mobile-menu a:hover,
.proj-mobile-menu a.active { color: var(--proj-gold); }

/* === Hero Section === */
.proj-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.proj-hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}

.proj-hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(10,10,10,0.6) 0%,
        rgba(10,10,10,0.4) 50%,
        rgba(10,10,10,0.9) 100%
    );
}

.proj-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

.proj-section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #d4af37;
    margin-bottom: 20px;
}

.proj-hero-title {
    font-family: var(--proj-font-heading);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 15px;
    color: #ffffff;
}

.proj-hero-subtitle {
    font-size: 1.1rem;
    color: var(--proj-text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* === Filter Bar === */
.proj-filter-section {
    position: relative;
    z-index: 10;
    padding: 40px 60px;
    background: var(--proj-bg);
}

.proj-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.proj-filter-btn {
    background: var(--proj-surface);
    color: var(--proj-text-muted);
    border: 1px solid var(--proj-border);
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--proj-font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--proj-transition);
}

.proj-filter-btn:hover {
    border-color: var(--proj-border-hover);
    color: var(--proj-text);
}

.proj-filter-btn.active {
    background: var(--proj-gold);
    color: var(--proj-bg);
    border-color: var(--proj-gold);
}

/* === Projects Grid === */
.proj-grid-section {
    padding: 20px 60px 100px;
    background: var(--proj-bg);
}

.proj-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Project Card */
.proj-card {
    background: var(--proj-surface);
    border-radius: var(--proj-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--proj-transition);
    border: 1px solid var(--proj-border);
}

.proj-card:hover {
    transform: translateY(-8px);
    border-color: var(--proj-border-hover);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.proj-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.proj-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.proj-card:hover .proj-card-image img {
    transform: scale(1.08);
}

.proj-card-image-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(10,10,10,0.8) 100%);
    opacity: 0;
    transition: var(--proj-transition);
}

.proj-card:hover .proj-card-image-overlay {
    opacity: 1;
}

.proj-card-image-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: var(--proj-text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0;
    transition: var(--proj-transition);
}

.proj-card:hover .proj-card-image-count {
    opacity: 1;
}

.proj-card-info {
    padding: 24px;
}

.proj-card-name {
    font-family: var(--proj-font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
}

.proj-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--proj-text-dim);
}

.proj-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-card-meta i {
    color: var(--proj-gold);
    font-size: 0.7rem;
}

/* Loading State */
.proj-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--proj-text-muted);
}

.proj-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--proj-border);
    border-top-color: var(--proj-gold);
    border-radius: 50%;
    animation: proj-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes proj-spin {
    to { transform: rotate(360deg); }
}

.proj-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--proj-text-muted);
}

/* === Lightbox === */
.proj-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.proj-lightbox.open { display: flex; }

.proj-lightbox-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.proj-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.proj-lightbox-image-wrapper {
    max-width: 100%;
    max-height: 75vh;
    overflow: hidden;
    border-radius: var(--proj-radius);
}

.proj-lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.proj-lightbox-caption {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--proj-text-muted);
    text-align: center;
}

.proj-lightbox-counter {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--proj-text-dim);
}

.proj-lightbox-close,
.proj-lightbox-prev,
.proj-lightbox-next {
    position: fixed;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--proj-text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--proj-transition);
    z-index: 10;
}

.proj-lightbox-close:hover,
.proj-lightbox-prev:hover,
.proj-lightbox-next:hover {
    background: var(--proj-gold);
    color: var(--proj-bg);
    border-color: var(--proj-gold);
}

.proj-lightbox-close { top: 30px; right: 30px; }
.proj-lightbox-prev { top: 50%; left: 30px; transform: translateY(-50%); }
.proj-lightbox-next { top: 50%; right: 30px; transform: translateY(-50%); }

/* === Project Detail Modal === */
.proj-detail-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1500;
    overflow-y: auto;
}

.proj-detail-modal.open { display: block; }

.proj-detail-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.proj-detail-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 80px auto;
    background: var(--proj-surface);
    border-radius: 12px;
    padding: 50px;
    border: 1px solid var(--proj-border);
}

.proj-detail-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none;
    border: none;
    color: var(--proj-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--proj-transition);
}
.proj-detail-close:hover { color: var(--proj-gold); }

.proj-detail-header { margin-bottom: 30px; }

.proj-detail-header h2 {
    font-family: var(--proj-font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.proj-detail-meta {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--proj-text-muted);
}

.proj-detail-meta i {
    color: var(--proj-gold);
    margin-right: 6px;
}

.proj-detail-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--proj-text-muted);
    margin-bottom: 40px;
}

/* Detail Gallery (Masonry-style) */
.proj-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.proj-gallery-item {
    border-radius: var(--proj-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--proj-transition);
    position: relative;
}

.proj-gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.proj-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 180px;
}

.proj-gallery-item:nth-child(3n+1) {
    grid-row: span 2;
}

/* === Footer === */
.proj-footer {
    background: var(--proj-surface-3);
    border-top: 1px solid var(--proj-border);
    padding: 60px 60px 30px;
}

.proj-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.proj-footer-brand h3 {
    font-family: var(--proj-font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

.proj-footer-brand p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-style: italic;
}

.proj-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.proj-footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.proj-footer-links a:hover { color: #ffffff; }

.proj-footer-contact p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-align: right;
}

.proj-footer-bottom {
    border-top: 1px solid var(--proj-border);
    padding-top: 20px;
    text-align: center;
}

.proj-footer-bottom p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .proj-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .proj-footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .proj-footer-links { justify-content: center; }
    .proj-footer-contact p { text-align: center; }
}

@media (max-width: 768px) {
    .proj-nav {
        padding: 15px 20px;
    }
    .proj-nav-logo { height: 80px; }
    .proj-nav-links { display: none; }
    .proj-mobile-toggle { display: block; }
    
    .proj-hero { height: 50vh; min-height: 300px; }
    .proj-hero-title { font-size: 2.5rem; }
    .proj-hero-subtitle { font-size: 0.95rem; }
    
    .proj-filter-section { padding: 30px 20px; }
    .proj-grid-section { padding: 20px 20px 60px; }
    .proj-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .proj-detail-content { padding: 30px 20px; margin: 40px 15px; }
    .proj-detail-header h2 { font-size: 1.6rem; }
    .proj-detail-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .proj-gallery-item:nth-child(3n+1) {
        grid-row: span 1;
    }
    
    .proj-footer { padding: 40px 20px 20px; }
    
    .proj-lightbox-prev { left: 10px; }
    .proj-lightbox-next { right: 10px; }
    .proj-lightbox-close { top: 15px; right: 15px; }
}

@media (max-width: 480px) {
    .proj-hero-title { font-size: 2rem; }
    .proj-filter-btn { padding: 8px 16px; font-size: 0.7rem; }
    .proj-detail-gallery { grid-template-columns: 1fr; }
}
