/* ==========================================
   PORTFOLIO PAGE STYLES - MASONRY LAYOUT
   ========================================== */

/* Portfolio Hero Section */
.portfolio-hero {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(161, 0, 255, 0.08), rgba(255, 138, 76, 0.06));
    padding: 12rem 0 6rem;
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(161, 0, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 138, 76, 0.08) 0%, transparent 30%);
    pointer-events: none;
}

.portfolio-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.hero-text-stack {
    margin-bottom: 1rem; /* Reduced from 3rem to 1rem for tighter spacing */
}

.portfolio-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    margin-bottom: 2rem;
    line-height: 1.2;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.title-line {
    display: block;
    color: var(--text-primary);
}

.title-line.accent {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

.portfolio-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
    font-style: normal;
}

.portfolio-subtitle em {
    color: var(--primary-color);
    font-style: italic;
    font-weight: 600;
}

/* Portfolio Metrics */
.portfolio-metrics {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem; /* Reduced from 3rem to 1.5rem for tighter layout */
    flex-wrap: wrap;
}

.metric-card {
    background: #FFFFFF;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    min-width: 160px;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #000000;
    gap: 0.8rem;
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.metric-visual {
    width: 50px;
    height: 50px;
    margin: 0; /* Remove margin to use gap from parent card */
    position: relative;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.rocket-3d {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 
        0 8px 16px rgba(255, 107, 107, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1);
    transform: rotate(-45deg);
}

.rocket-3d::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #fff, #f0f0f0);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.target-3d {
    background: linear-gradient(145deg, #0ea5e9, #0284c7);
    border-radius: 50%;
    box-shadow: 
        0 8px 16px rgba(14, 165, 233, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.target-3d::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.target-3d::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.chart-3d {
    background: linear-gradient(145deg, #a855f7, #9333ea);
    border-radius: 12px;
    box-shadow: 
        0 8px 16px rgba(168, 85, 247, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.chart-3d::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 10px;
    right: 10px;
    height: 20px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.9) 25%, 
        transparent 25%, 
        transparent 35%,
        rgba(255, 255, 255, 0.9) 35%, 
        rgba(255, 255, 255, 0.9) 55%, 
        transparent 55%, 
        transparent 65%,
        rgba(255, 255, 255, 0.9) 65%, 
        rgba(255, 255, 255, 0.9) 100%);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.metric-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem; /* Consistent spacing between number and label */
}

.metric-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0; /* Remove margin to use gap from parent */
}

.metric-label {
    font-size: 0.9rem;
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero CTA */
.hero-cta {
    margin-top: 3rem;
    padding: 2rem 0;
}

.scroll-hint {
    font-size: 0.95rem;
    color: rgba(107, 114, 128, 0.8);
    font-weight: 400;
    opacity: 0.7;
    animation: bounce 2s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    display: inline-block;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Filter Pills */
.portfolio-masonry {
    padding: 2rem 0;
}

.filter-pills {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.pill {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.pill:hover::before {
    left: 100%;
}

.pill:hover,
.pill.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
    border-color: var(--primary-color);
}

.pill:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.3);
}

/* Masonry Grid */
.masonry-grid {
    columns: 4;
    column-gap: 15px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Masonry Item Sizes */
.masonry-item {
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
    break-inside: avoid;
}

.masonry-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Remove fixed heights - let content determine size */
.masonry-item.small,
.masonry-item.medium, 
.masonry-item.large,
.masonry-item.wide {
    height: auto;
}

/* Item Content */
.item-content {
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.item-content img,
.item-content video {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s ease, opacity 0.5s ease;
    display: block;
    opacity: 1; /* Changed from 0 to 1 - let JavaScript handle opacity */
    background: #f5f5f5;
}

.masonry-item:hover .item-content img,
.masonry-item:hover .item-content video {
    transform: scale(1.02);
}

/* Video Play Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-btn i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-left: 4px;
}

.masonry-item:hover .play-btn {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Item Overlay */
.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.masonry-item:hover .item-overlay {
    transform: translateY(0);
}

.overlay-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.overlay-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* PDF Content Styling */
.pdf-content {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(161, 0, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pdf-preview-large {
    color: var(--text-primary);
}

.pdf-preview-large i {
    font-size: 3rem;
    color: #dc2626;
    margin-bottom: 1rem;
    display: block;
}

.pdf-preview-large h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.pdf-preview-large p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* PDF Actions */
.pdf-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.pdf-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.pdf-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        grid-auto-rows: 180px;
        gap: 15px;
    }
    
    .masonry-item.wide {
        grid-column-end: span 1;
    }
    
    .portfolio-title {
        font-size: 2.5rem;
    }
    
    .filter-pills {
        gap: 0.5rem;
    }
    
    .pill {
        padding: 0.6rem 1.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
    
    .masonry-item.large,
    .masonry-item.medium {
        grid-row-end: span 2;
    }
}

.portfolio-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
}

.portfolio-stats .stat-item {
    text-align: center;
}

.portfolio-stats .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.portfolio-stats .stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Portfolio Filter */
.portfolio-filter-section {
    padding: 2rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

/* Portfolio Gallery - Masonry Layout */
.portfolio-gallery {
    padding: 4rem 0;
}

/* Video Container - Masonry */
.video-container {
    position: relative;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}

.video-play-btn:hover {
    background: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Placeholder Images */
.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(161, 0, 255, 0.1));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.placeholder-image i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-image p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Load More Button */
.load-more-section {
    text-align: center;
    margin-top: 3rem;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 212, 255, 0.3);
}

.load-more-btn i {
    transition: transform 0.3s ease;
}

.load-more-btn:hover i {
    transform: translateY(2px);
}

/* Content Modal */
.content-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.modal-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--bg-secondary);
}

.modal-media img,
.modal-media video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
}

.modal-info {
    padding: 2rem;
    background: var(--bg-color);
    border-top: 1px solid rgba(0, 212, 255, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        gap: 25px;
    }
    
    .masonry-item.wide {
        grid-column: span 1;
        height: 350px;
    }
}

@media (max-width: 1024px) {
    .masonry-grid {
        columns: 3;
        column-gap: 12px;
    }
}

@media (max-width: 768px) {
    .portfolio-hero {
        padding: 12rem 0 4rem;
        min-height: 60vh;
    }
    
    .portfolio-subtitle {
        font-size: 1.2rem;
        padding: 0 1rem;
    }
    
    .portfolio-metrics {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .metric-card {
        padding: 1.5rem 1rem;
        min-width: 140px;
        height: 160px;
    }
    
    .metric-visual {
        width: 45px;
        height: 45px;
        margin-bottom: 1rem;
    }
    
    .metric-number {
        font-size: 2rem;
    }
    
    .masonry-grid {
        columns: 2;
        column-gap: 10px;
        padding: 0 10px;
    }
    
    .filter-pills {
        gap: 0.8rem;
        margin-bottom: 2.5rem;
    }

    .pill {
        padding: 0.7rem 1.8rem;
        font-size: 0.85rem;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .portfolio-hero {
        padding: 12rem 0 3rem;
        min-height: 50vh;
    }
    
    .hero-text-stack {
        margin-bottom: 2rem;
    }
    
    .portfolio-subtitle {
        font-size: 1.1rem;
    }
    
    .portfolio-metrics {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .metric-card {
        padding: 1.2rem 1rem;
        min-width: auto;
        max-width: 200px;
        margin: 0 auto;
        height: 150px;
    }
    
    .metric-visual {
        width: 40px;
        height: 40px;
        margin-bottom: 0.8rem;
    }
    
    .scroll-hint {
        font-size: 0.9rem;
    }
    
    .filter-pills {
        flex-direction: column;
        align-items: center;
    }
    
    .pill {
        min-width: 150px;
    }
    
    .masonry-grid {
        columns: 1;
        column-gap: 15px;
    }
    
    .masonry-item {
        height: 280px;
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.stagger-animation {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }