/* ============================================
   REFERENCES PAGE - Portfolio Showcase
   v1.0 - Cosmic Portfolio Grid
   ============================================ */

/* --- REFERENCES HERO SECTION --- */
.refs-hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 160px 0 140px;
    background-color: #080912;
}

/* Hero Background */
.refs-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../images/hero-images/hero-nebula-blue.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Hero Overlay */
.refs-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(5, 5, 8, 0.4) 0%,
            rgba(5, 5, 8, 0.3) 40%,
            rgba(5, 5, 8, 0.7) 80%,
            #080912 100%);
}

/* Hero Content */
.refs-hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.refs-hero-content .section-tag-cosmic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    margin-bottom: var(--spacing-md);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.refs-hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #fff;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    line-height: 1.1;
}

.refs-hero-content .hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto;
}

/* Hero to Stats transition */
.refs-hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 3;
}


/* ============================================
   STATS SECTION
   ============================================ */

.refs-stats-section {
    position: relative;
    padding: 80px 0;
    background: #080912;
}

/* Gradient mask for smooth entry */
.refs-stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.5) 50%,
            transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item {
    --stat-color: 45, 212, 191;
    --stat-hex: #2dd4bf;

    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

/* Stat Color Variations */
.stat-item:nth-child(1) {
    --stat-color: 45, 212, 191;
    --stat-hex: #2dd4bf;
}

.stat-item:nth-child(2) {
    --stat-color: 168, 85, 247;
    --stat-hex: #a855f7;
}

.stat-item:nth-child(3) {
    --stat-color: 236, 72, 153;
    --stat-hex: #ec4899;
}

.stat-item:nth-child(4) {
    --stat-color: 251, 191, 36;
    --stat-hex: #fbbf24;
}

.stat-item:hover {
    background: rgba(var(--stat-color), 0.08);
    border-color: rgba(var(--stat-color), 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(var(--stat-color), 0.15);
}

.stat-item:hover .stat-number {
    color: var(--stat-hex);
    text-shadow: 0 0 20px rgba(var(--stat-color), 0.5);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #2dd4bf;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.stat-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ============================================
   PORTFOLIO SECTION
   ============================================ */

.refs-portfolio-section {
    position: relative;
    padding: 100px 0 140px;
    background: linear-gradient(180deg,
            #080912 0%,
            #0a0b16 50%,
            #080912 100%);
}

.portfolio-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.portfolio-intro .section-tag-cosmic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    margin-bottom: var(--spacing-md);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.portfolio-intro h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.portfolio-intro p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* References Grid */
.refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Reference Card */
.ref-card {
    --ref-color: 45, 212, 191;
    --ref-hex: #2dd4bf;

    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 35px;
    position: relative;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Reference Card Color Variations */
.ref-card:nth-child(1) {
    --ref-color: 59, 130, 246;
    --ref-hex: #3b82f6;
}

.ref-card:nth-child(2) {
    --ref-color: 168, 85, 247;
    --ref-hex: #a855f7;
}

.ref-card:nth-child(3) {
    --ref-color: 236, 72, 153;
    --ref-hex: #ec4899;
}

.ref-card:nth-child(4) {
    --ref-color: 16, 185, 129;
    --ref-hex: #10b981;
}

.ref-card:nth-child(5) {
    --ref-color: 45, 212, 191;
    --ref-hex: #2dd4bf;
}

.ref-card:nth-child(6) {
    --ref-color: 251, 191, 36;
    --ref-hex: #fbbf24;
}

.ref-card:nth-child(7) {
    --ref-color: 139, 92, 246;
    --ref-hex: #8b5cf6;
}

.ref-card:nth-child(8) {
    --ref-color: 244, 114, 182;
    --ref-hex: #f472b6;
}

/* Tech Corners */
.ref-card::before,
.ref-card::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: rgba(var(--ref-color), 0.3);
    border-style: solid;
    border-width: 0;
    transition: all 0.3s ease;
}

.ref-card::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.ref-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.ref-card:hover {
    background: rgba(var(--ref-color), 0.05);
    border-color: rgba(var(--ref-color), 0.2);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(var(--ref-color), 0.1);
}

.ref-card:hover::before,
.ref-card:hover::after {
    border-color: rgba(var(--ref-color), 0.6);
    width: 30px;
    height: 30px;
}

/* Logo */
.ref-logo {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    padding: 10px;
}

.ref-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    /* Ensure it stays white if transparent, or force white if colored */
}

/* Info */
.ref-info {
    flex: 1;
}

.ref-info h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Service Badges */
.service-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 3px;
    margin-right: 8px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-web {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-mobile {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-ecom {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-ai {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cloud {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

/* Clickable Service Badge Links */
.service-badges-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.service-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.service-badge-link.static {
    pointer-events: none;
    opacity: 0.9;
}

.service-badge-link.badge-web {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.service-badge-link.badge-web:hover {
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.service-badge-link.badge-qr {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.service-badge-link.badge-qr:hover {
    background: rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    transform: translateY(-2px);
}

.service-badge-link.badge-mobile {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.service-badge-link.badge-mobile:hover {
    background: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.service-badge-link.badge-ecom {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.service-badge-link.badge-ecom:hover {
    background: rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
    transform: translateY(-2px);
}

.service-badge-link.badge-ai {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.service-badge-link.badge-ai:hover {
    background: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.service-badge-link.badge-cloud {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

.service-badge-link.badge-cloud:hover {
    background: rgba(45, 212, 191, 0.3);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.4);
    transform: translateY(-2px);
}

/* Light background logo variant (for logos with light colors) */
.ref-logo-light {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.ref-logo-light img {
    filter: none;
    /* Remove white filter for colored logos */
}

.ref-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    line-height: 1.5;
}

/* Project Link */
.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2dd4bf;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.ref-link:hover {
    color: #fff;
}

.link-arrow {
    transition: transform 0.3s ease;
}

.ref-link:hover .link-arrow {
    transform: translateX(5px);
}


/* ============================================
   FOOTER FIX
   ============================================ */

.refs-footer-wrapper {
    background-color: #080912;
    position: relative;
    z-index: 5;
}

.refs-footer-wrapper .nebula-footer {
    padding-top: 180px;
}

.refs-footer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.7) 30%,
            transparent 100%);
    z-index: 10;
    pointer-events: none;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .refs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .refs-hero-section {
        min-height: 60vh;
        padding: 120px 0 100px;
    }

    .refs-stats-section {
        padding: 60px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .refs-portfolio-section {
        padding: 80px 0 100px;
    }

    .ref-card {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item {
        padding: 20px 15px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .refs-hero-content h1 {
        font-size: 2rem;
    }
}