/* ============================================
   PROJECTS.CSS — Gallery & Modal Styles
   ============================================ */

/* === PAGE HEADER EXTENSION === */
.page-header.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.project-count {
    text-align: right;
}

.project-count .number {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: 500;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.project-count .label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* === FEATURED PROJECT === */
.featured-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-20) var(--space-12);
}

.featured-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-6);
}

.featured-label::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--accent-orange);
}

.featured-project {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: var(--space-16);
    align-items: center;
    background: linear-gradient(155deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    position: relative;
    overflow: hidden;
}

.featured-project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-teal), var(--accent-gold));
    background-size: 200% 100%;
    animation: shimmer 4s linear infinite;
}

.featured-info h2 {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 500;
    margin-bottom: var(--space-5);
    letter-spacing: -0.02em;
}

.featured-info > p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-8);
}

.featured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.featured-tag {
    background: var(--accent-gold-muted);
    color: var(--accent-gold);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border-subtle);
}

.featured-visual {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.featured-visual .photo-placeholder {
    border-radius: var(--radius-xl);
}

/* === LIVE MAP PREVIEW === */
.map-preview-container {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-muted);
    background: #0d1117;
}

.map-preview {
    width: 100%;
    height: 100%;
    background: #0d1117;
}

.map-overlay-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: 
        linear-gradient(to top, rgba(10, 10, 10, 0.8) 0%, transparent 30%),
        linear-gradient(to bottom, rgba(10, 10, 10, 0.3) 0%, transparent 20%),
        linear-gradient(135deg, rgba(212, 168, 83, 0.1) 0%, transparent 50%);
    border-radius: var(--radius-xl);
}

.map-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--accent-teal);
    border: 1px solid rgba(62, 184, 168, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-teal);
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent-teal);
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Featured Stats */
.featured-stats {
    display: flex;
    gap: var(--space-8);
    margin-bottom: var(--space-6);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--border-muted);
    border-bottom: 1px solid var(--border-muted);
}

.featured-stat {
    display: flex;
    flex-direction: column;
}

.featured-stat .stat-number {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    color: var(--accent-teal);
    line-height: 1;
}

.featured-stat .stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: var(--space-1);
}

/* Leaflet overrides for dark theme */
.leaflet-container {
    background: #0d1117 !important;
    font-family: var(--font-body) !important;
}

.leaflet-control-zoom {
    display: none !important;
}

.marker-cluster {
    background: transparent !important;
}

/* === PROJECTS GRID === */
.projects-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-12) var(--space-24);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

/* === PROJECT CARD === */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-out);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(135deg, transparent 30%, var(--accent-gold) 70%, var(--accent-teal) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--duration-slow) ease;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-14px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.project-card:hover::before {
    opacity: 1;
}

.project-preview {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.project-preview .photo-placeholder {
    height: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-muted);
}

.project-card:hover .photo-placeholder {
    border-color: var(--accent-gold);
}

.project-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(12px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 3;
    border: 1px solid var(--border-muted);
}

.project-info {
    padding: var(--space-6);
}

.project-info h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
    transition: color var(--duration-base) ease;
}

.project-card:hover .project-info h3 {
    color: var(--accent-gold);
}

.project-info p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.65;
    margin-bottom: var(--space-5);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.project-tag {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    border: 1px solid var(--border-muted);
    transition: all var(--duration-base) ease;
}

.project-card:hover .project-tag {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--space-8);
    opacity: 0;
    transition: opacity var(--duration-base) ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-2xl);
    max-width: 850px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.92) translateY(30px);
    opacity: 0;
    animation: modalReveal 0.5s var(--ease-out) forwards;
}

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

.modal-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-muted);
    color: var(--text-primary);
    font-size: var(--text-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-base) var(--ease-out);
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-gold);
    color: var(--text-inverse);
    border-color: var(--accent-gold);
    transform: rotate(90deg);
}

.modal-header {
    padding: var(--space-10) var(--space-10) var(--space-6);
    border-bottom: 1px solid var(--border-muted);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.modal-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.modal-body {
    padding: var(--space-10);
}

.modal-photo .photo-placeholder {
    margin-bottom: var(--space-8);
}

.modal-section {
    margin-bottom: var(--space-8);
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h4 {
    font-size: var(--text-sm);
    color: var(--accent-teal);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: var(--text-base);
}

.modal-section ul {
    list-style: none;
    color: var(--text-secondary);
}

.modal-section li {
    padding: var(--space-3) 0;
    padding-left: var(--space-8);
    position: relative;
    line-height: 1.7;
}

.modal-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-weight: 700;
}

.modal-section li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .featured-project {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .page-header.projects-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .project-count {
        text-align: left;
    }
    
    .featured-section,
    .projects-section {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .featured-section,
    .projects-section {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
    
    .featured-section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }
    
    .featured-project {
        padding: var(--space-8);
        border-radius: var(--radius-xl);
    }
    
    .featured-info h2 {
        font-size: var(--text-3xl);
    }
    
    .featured-stats {
        flex-wrap: wrap;
        gap: var(--space-6);
    }
    
    .featured-stat .stat-number {
        font-size: var(--text-2xl);
    }
    
    .map-preview-container {
        aspect-ratio: 16/10;
    }
    
    .modal {
        margin: var(--space-4);
        max-height: 92vh;
        border-radius: var(--radius-xl);
    }
    
    .modal-header,
    .modal-body {
        padding: var(--space-6);
    }
    
    .modal-header h2 {
        font-size: var(--text-2xl);
        padding-right: var(--space-12);
    }
    
    .modal-close {
        top: var(--space-4);
        right: var(--space-4);
        width: 40px;
        height: 40px;
    }
}
