/* ==========================================
   ROIATEK AI - Events & Products Gallery CSS
   ========================================== */

/* ---------- Events Gallery Section ---------- */
.events-gallery {
    background: transparent;
    position: relative;
    overflow: hidden;
    padding-top: var(--space-5xl);
    margin-top: 0;
}

/* Uses unified body gradient */
.events-gallery::before {
    content: none;
}

/* Background container */
.events-gallery .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: transparent;
}

/* NO additional lighting - use body gradient */
.events-gallery .hero-bg::before {
    content: none;
}

/* NO darkening overlay - use body gradient */
.events-gallery .hero-bg::after {
    content: none;
}

/* h1-2.jpg Image - LEFT CORNER, Blends smoothly into gradient */
.events-gallery .hero-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 70%;
    height: 100%;
    background-image: url('../images/h1-2.jpg');
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    opacity: 0.95;
    z-index: 1;
    /* Smooth fade on all edges - no sharp borders (mirrored from Home) */
    mask-image: radial-gradient(
        ellipse 85% 95% at 20% 50%,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.95) 35%,
        rgba(0,0,0,0.75) 55%,
        rgba(0,0,0,0.4) 75%,
        rgba(0,0,0,0.15) 90%,
        transparent 100%
    );
    -webkit-mask-image: radial-gradient(
        ellipse 85% 95% at 20% 50%,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.95) 35%,
        rgba(0,0,0,0.75) 55%,
        rgba(0,0,0,0.4) 75%,
        rgba(0,0,0,0.15) 90%,
        transparent 100%
    );
    mix-blend-mode: normal;
}

/* Subtle glow on left side */
.events-gallery .hero-image-overlay::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: 
        radial-gradient(
            ellipse 80% 90% at 15% 50%,
            rgba(138, 43, 226, 0.12) 0%,
            rgba(138, 43, 226, 0.06) 40%,
            transparent 70%
        );
    filter: blur(60px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* No ::after overlay */
.events-gallery .hero-image-overlay::after {
    content: none;
}

/* Add Purple Circular Lighting on Left Side */
/* Remove conflicting gradient overlay */
.events-gallery .hero-gradient {
    display: none;
}

/* Subtle Grid Overlay - Behind image */
.events-gallery .hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 44, 191, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
}


/* Ensure Content is Above Background */
.events-gallery .container {
    position: relative;
    z-index: 10;
}


/* 4-Item Single Line Layout - Small, Large, Small, Large Pattern */
.events-grid-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) 0;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 0; /* Sharp corners */
    cursor: pointer;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

/* Small squares */
.photo-small {
    width: 280px;
    height: 280px;
}

/* Large squares */
.photo-large {
    width: 400px;
    height: 400px;
}

.photo-item:hover {
    transform: translateY(-15px) scale(1.03);
    z-index: 10;
}

.photo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0; /* Sharp corners */
    background: var(--color-bg-card);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.8);
    transition: all var(--transition-normal);
}

.photo-item:hover .photo-wrapper {
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.95),
        0 0 120px rgba(123, 44, 191, 0.8),
        inset 0 0 150px rgba(123, 44, 191, 0.5);
}

/* Purple lighting overlay on hover */
.photo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(123, 44, 191, 0) 0%,
        rgba(123, 44, 191, 0.6) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: screen;
}

.photo-item:hover .photo-wrapper::before {
    opacity: 1;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow), filter var(--transition-normal);
}

.photo-item:hover .photo-wrapper img {
    transform: scale(1.2);
    filter: brightness(1.1) contrast(1.1) saturate(1.1);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--space-xl);
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0) 0%,
        rgba(10, 10, 15, 0.7) 40%,
        rgba(10, 10, 15, 0.98) 100%
    );
    transition: all var(--transition-normal);
    z-index: 3;
}

.photo-item:hover .photo-overlay {
    background: linear-gradient(
        180deg,
        rgba(123, 44, 191, 0.2) 0%,
        rgba(123, 44, 191, 0.5) 30%,
        rgba(10, 10, 15, 0.92) 70%,
        rgba(10, 10, 15, 1) 100%
    );
    padding-bottom: calc(var(--space-xl) + 12px);
}

.photo-info {
    width: 100%;
    position: relative;
    z-index: 4;
    transition: transform var(--transition-normal);
}

.photo-item:hover .photo-info {
    transform: translateY(-10px);
}

.photo-info h4 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
    text-shadow: 
        0 4px 28px rgba(0, 0, 0, 1),
        0 0 55px rgba(123, 44, 191, 0.7);
    line-height: 1.15;
    letter-spacing: 0.02em;
    transition: all var(--transition-normal);
}

/* Larger titles for large photos */
.photo-large .photo-info h4 {
    font-size: 1.75rem;
}

.photo-item:hover .photo-info h4 {
    text-shadow: 
        0 4px 28px rgba(0, 0, 0, 1),
        0 0 70px rgba(123, 44, 191, 1),
        0 0 90px rgba(247, 37, 133, 0.7);
}

.photo-info p {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 600;
    text-shadow: 
        0 2px 24px rgba(0, 0, 0, 1),
        0 0 40px rgba(0, 245, 212, 0.8);
    line-height: 1.5;
    opacity: 0.95;
    letter-spacing: 0.02em;
    transition: all var(--transition-normal);
}

.photo-large .photo-info p {
    font-size: 1rem;
}

.photo-item:hover .photo-info p {
    opacity: 1;
    color: #00f5d4;
    text-shadow: 
        0 0 30px rgba(0, 245, 212, 1),
        0 0 60px rgba(123, 44, 191, 1);
}

/* Responsive - Maintain Single Line on Desktop/Tablet */
@media (max-width: 1400px) {
    .events-grid-wrapper {
        gap: var(--space-lg);
    }
    
    .photo-small {
        width: 250px;
        height: 250px;
    }
    
    .photo-large {
        width: 360px;
        height: 360px;
    }
    
    .photo-info h4 {
        font-size: 1.2rem;
    }
    
    .photo-large .photo-info h4 {
        font-size: 1.6rem;
    }
}

@media (max-width: 1200px) {
    .events-grid-wrapper {
        gap: var(--space-md);
    }
    
    .photo-small {
        width: 220px;
        height: 220px;
    }
    
    .photo-large {
        width: 320px;
        height: 320px;
    }
    
    .photo-overlay {
        padding: var(--space-lg);
    }
    
    .photo-info h4 {
        font-size: 1.1rem;
    }
    
    .photo-large .photo-info h4 {
        font-size: 1.5rem;
    }
    
    .photo-info p {
        font-size: 0.85rem;
    }
    
    .photo-large .photo-info p {
        font-size: 0.95rem;
    }
}

/* Stack vertically on tablet/mobile */
@media (max-width: 1024px) {
    .events-grid-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .photo-small {
        width: 280px;
        height: 280px;
    }
    
    .photo-large {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .events-grid-wrapper {
        flex-direction: column;
        gap: var(--space-xl);
    }
    
    .photo-small,
    .photo-large {
        width: 100%;
        max-width: 400px;
        height: 400px;
    }
    
    .photo-overlay {
        padding: var(--space-lg);
    }
    
    .photo-info h4 {
        font-size: 1.4rem;
    }
    
    .photo-large .photo-info h4 {
        font-size: 1.6rem;
    }
    
    .photo-info p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .photo-small,
    .photo-large {
        max-width: 100%;
        height: 350px;
    }
    
    .photo-info h4 {
        font-size: 1.3rem;
    }
    
    .photo-large .photo-info h4 {
        font-size: 1.5rem;
    }
}


.products-gallery .container {
    position: relative;
    z-index: 1;
}

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

.product-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Fluorescent purple glow on hover */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-2xl);
    background: 
        radial-gradient(
            circle at 50% 50%,
            rgba(138, 43, 226, 0.15) 0%,
            transparent 70%
        );
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: 0;
}

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

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(138, 43, 226, 0.4),
        0 0 80px rgba(138, 43, 226, 0.2),
        inset 0 0 60px rgba(138, 43, 226, 0.1);
}

.product-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    z-index: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-xs) var(--space-md);
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-bg-dark);
}

.product-content {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
}

.product-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.product-description {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    flex: 1;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.feature-tag {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
}

.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
}

/* ---------- Responsive Styles ---------- */

/* Tablet */
@media (max-width: 1024px) {
    .events-photos-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 250px;
        gap: var(--space-md);
    }
    
    .photo-item-large {
        grid-column: span 2;
    }
    
    .photo-item-tall {
        grid-row: span 2;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .events-photos-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
        gap: var(--space-md);
    }
    
    .photo-item-large {
        grid-column: span 2;
    }
    
    .photo-item-tall {
        grid-row: span 1;
    }
    
    .photo-overlay {
        background: linear-gradient(
            180deg,
            rgba(10, 10, 15, 0) 0%,
            rgba(10, 10, 15, 0.5) 40%,
            rgba(10, 10, 15, 0.95) 100%
        );
        padding: var(--space-md);
    }
    
    .photo-info h4 {
        font-size: 1rem;
    }
    
    .photo-item-large .photo-info h4 {
        font-size: 1.125rem;
    }
    
    .photo-info p {
        font-size: 0.75rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .product-card {
        margin: 0 auto;
        max-width: 400px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .events-photos-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 280px;
    }
    
    .photo-item-large,
    .photo-item-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .video-stats {
        flex-direction: column;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
    }
}

/* ---------- AI Advertising Portfolio Section ---------- */
.ai-advertising {
    background: transparent;
    position: relative;
    overflow: hidden;
    padding: 0; /* Remove padding for full grid */
}

.ai-advertising .container {
    max-width: 100%;
    padding: 0;
}

.ai-advertising .section-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-lg);
}

.advertising-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

/* Full Grid - No Gaps */
/* ---------- AI Advertising Random Overlapping Layout ---------- */
.ai-advertising {
    position: relative;
    padding: var(--space-5xl) 0;
    background: transparent;
    overflow: hidden;
}

.advertising-showcase {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    min-height: 800px;
}

/* Ad Items - Absolute Positioning for Overlap */
.ad-item {
    position: absolute;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0;
    transition: all var(--transition-normal);
}

/* Random Positions and Sizes - Overlapping */
.ad-item:nth-child(1) {
    width: 420px;
    height: 420px;
    top: 0;
    left: 0;
    z-index: 3;
}

.ad-item:nth-child(2) {
    width: 280px;
    height: 200px;
    top: 40px;
    right: 150px;
    z-index: 5;
}

.ad-item:nth-child(3) {
    width: 250px;
    height: 380px;
    top: 80px;
    right: 0;
    z-index: 2;
}

.ad-item:nth-child(4) {
    width: 350px;
    height: 350px;
    top: 350px;
    right: 280px;
    z-index: 6;
}

.ad-item:nth-child(5) {
    width: 220px;
    height: 220px;
    top: 350px;
    left: 50px;
    z-index: 4;
}

.ad-item:nth-child(6) {
    width: 300px;
    height: 200px;
    bottom: 0;
    left: 0;
    z-index: 2;
}

.ad-item:nth-child(7) {
    width: 260px;
    height: 260px;
    bottom: 20px;
    left: 320px;
    z-index: 7;
}

.ad-item:nth-child(8) {
    width: 450px;
    height: 300px;
    bottom: 0px;
    right: -50px;
    z-index: 3;
}

/* Hover brings to front */
.ad-item:hover {
    z-index: 100 !important;
    transform: scale(1.05);
}

.ad-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg-card);
    border: 1px solid rgba(0, 245, 212, 0.15);
    border-radius: 0;
    transition: all var(--transition-normal);
}

.ad-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover Effects */
.ad-item:hover .ad-wrapper {
    border-color: rgba(0, 245, 212, 0.5);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(0, 245, 212, 0.4);
}

.ad-item:hover .ad-wrapper img {
    transform: scale(1.1);
}

/* Overlay */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 10, 15, 0.6) 50%,
        rgba(10, 10, 15, 0.95) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.ad-item:hover .ad-overlay {
    opacity: 1;
}

/* Badge - NO BORDER RADIUS */
.ad-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 245, 212, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 245, 212, 0.5);
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-badge-video {
    background: rgba(247, 37, 133, 0.25);
    border-color: rgba(247, 37, 133, 0.5);
    color: var(--color-accent);
}

/* Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 245, 212, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
    transition: all var(--transition-normal);
}

.ad-item:hover .play-button {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 30px rgba(0, 245, 212, 0.6);
}

.play-button svg {
    width: 20px;
    height: 20px;
    margin-left: 3px;
}

/* Info */
.ad-info {
    position: relative;
    z-index: 2;
}

.ad-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
}

.ad-info p {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Responsive - Stack on Mobile */
@media (max-width: 968px) {
    .advertising-showcase {
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .ad-item {
        position: relative !important;
        width: 100% !important;
        height: 300px !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }
    
    .ad-item:hover {
        transform: scale(1.02);
    }
    
    .ad-overlay {
        opacity: 1;
        background: linear-gradient(
            180deg,
            transparent 0%,
            rgba(10, 10, 15, 0.8) 60%,
            rgba(10, 10, 15, 0.95) 100%
        );
    }
}

/* ===================================
   SOLUTIONS SECTION - Same as Training Sessions
   =================================== */

.solutions {
    background: transparent;
    position: relative;
    overflow: hidden;
    padding-top: var(--space-5xl);
    margin-top: var(--space-5xl);
}

/* Uses unified body gradient */
.solutions::before {
    content: none;
}

/* Background container */
.solutions .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: transparent;
}

/* NO additional lighting - use body gradient */
.solutions .hero-bg::before {
    content: none;
}

/* NO darkening overlay - use body gradient */
.solutions .hero-bg::after {
    content: none;
}

/* h1-2.jpg Image - LEFT CORNER, Actual Size, Clear Center, Edge Fade Only */
.solutions .hero-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-image: url('../images/h1-2.jpg');
    background-size: auto 100%;
    background-position: left center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 2;
    /* Simple horizontal fade - ONLY on right edge, center stays 100% clear */
    mask-image: linear-gradient(
        to right,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 65%,
        rgba(0,0,0,0.9) 74%,
        rgba(0,0,0,0.75) 82%,
        rgba(0,0,0,0.5) 88%,
        rgba(0,0,0,0.25) 94%,
        rgba(0,0,0,0.08) 98%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 65%,
        rgba(0,0,0,0.9) 74%,
        rgba(0,0,0,0.75) 82%,
        rgba(0,0,0,0.5) 88%,
        rgba(0,0,0,0.25) 94%,
        rgba(0,0,0,0.08) 98%,
        transparent 100%
    );
}

/* NO overlay on image - keep center crystal clear */
.solutions .hero-image-overlay::before {
    content: none;
}

/* NO radial gradient on image - removed to keep image clear */
.solutions .hero-image-overlay::after {
    content: none;
}

/* Remove conflicting gradient overlay */
.solutions .hero-gradient {
    display: none;
}

/* Subtle Grid Overlay - Behind image */
.solutions .hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 44, 191, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
}


/* Ensure Content is Above Background */
.solutions .container {
    position: relative;
    z-index: 10;
}
