/**
 * Creative Intro Section Widget Styles
 * Modern, clean design with floating badges and media cards
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --cis-primary: #fa5fb4;
    --cis-text-dark: #1c1c1c;
    --cis-text-muted: #000000;
    --cis-text-light: #f5f5f5;
    --cis-border: #d9d9d9;
    --cis-white: #ffffff;
    --cis-card-bg: #1c1c1c;
    --cis-radius-sm: 16px;
    --cis-radius-md: 24px;
    --cis-radius-lg: 32px;
    --cis-shadow-soft:
            0px 0.71px 0.42px -0.42px rgba(0, 0, 0, 0.04),
            0px 1.81px 1.08px -0.83px rgba(0, 0, 0, 0.04),
            0px 3.62px 2.17px -1.25px rgba(0, 0, 0, 0.04),
            0px 6.87px 4.12px -1.67px rgba(0, 0, 0, 0.04),
            0px 13.65px 8.19px -2.08px rgba(0, 0, 0, 0.04),
            0px 30px 18px -2.5px rgba(0, 0, 0, 0.04);
    --cis-shadow-heavy:
            0px 0.84px 0.5px -0.31px rgba(0, 0, 0, 0.13),
            0px 1.99px 1.19px -0.63px rgba(0, 0, 0, 0.13),
            0px 3.63px 2.18px -0.94px rgba(0, 0, 0, 0.13),
            0px 6.04px 3.62px -1.25px rgba(0, 0, 0, 0.13),
            0px 9.75px 5.85px -1.56px rgba(0, 0, 0, 0.13),
            0px 15.96px 9.57px -1.88px rgba(0, 0, 0, 0.13),
            0px 27.48px 16.49px -2.19px rgba(0, 0, 0, 0.13),
            0px 50px 30px -2.5px rgba(0, 0, 0, 0.13);
}

/* ============================================
   Section Container
   ============================================ */
.cis-section {
    background-color: var(--cis-white);
    padding: 80px 60px;
    width: 100%;
    box-sizing: border-box;
}

.cis-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

/* ============================================
   Content Blocks
   ============================================ */
.cis-content-block {
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
}

.cis-content-block--left {
    /* Left block: media on top, text below */
}

.cis-content-block--right {
    /* Right block: text on top, media below */
}

/* ============================================
   Text Content
   ============================================ */
.cis-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Tag Badge - Hero Eyebrow Style */
.cis-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #17468A;
    background: linear-gradient(135deg,
        rgba(23, 70, 138, 0.08) 0%,
        rgba(30, 90, 173, 0.08) 100%);
    border: 1px solid rgba(23, 70, 138, 0.2);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Shimmer effect */
.cis-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(23, 70, 138, 0.15),
        transparent);
    animation: cis-shimmer 3s infinite;
}

@keyframes cis-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.cis-tag:hover {
    border-color: rgba(23, 70, 138, 0.4);
    background: linear-gradient(135deg,
        rgba(23, 70, 138, 0.12) 0%,
        rgba(30, 90, 173, 0.12) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 70, 138, 0.15);
}

/* Title */
.cis-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    line-height: 1.25;
    color: var(--cis-text-dark);
    margin-top: 50px;
    letter-spacing: -0.02em;
}

/* Description */
.cis-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--cis-text-muted);
    margin: 0;
    max-width: 480px;
}

/* ============================================
   Media Wrapper (relative container)
   ============================================ */
.cis-media-wrapper {
    position: relative;
    min-height: 400px;
}

/* ============================================
   Media Cards Container
   ============================================ */
.cis-media-cards {
    display: flex;
    gap: 12px;
    height: 100%;
}

.cis-media-cards--multiple {
    /* When multiple cards, make them overlap slightly */
}

.cis-media-cards--multiple .cis-media-card:nth-child(2) {
    margin-left: -20px;
    margin-top: 40px;
}

/* ============================================
   Individual Media Card
   ============================================ */
.cis-media-card {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 9 / 16;
    border-radius: var(--cis-radius-lg);
    overflow: hidden;
    box-shadow: var(--cis-shadow-heavy);
    flex-shrink: 0;
}

.cis-media-card__content {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--cis-card-bg);
    border-radius: inherit;
    overflow: hidden;
}

/* Pattern Background */
.cis-media-card__pattern {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    background-position: left top;
    background-size: 64px auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='126' height='126'%3E%3Cpath d='M126 0v21.584L21.584 126H0v-17.585L108.415 0H126Zm0 108.414V126h-17.586L126 108.414Zm0-84v39.171L63.585 126H24.414L126 24.414Zm0 42v39.17L105.584 126h-39.17L126 66.414ZM105.586 0 0 105.586V66.415L66.415 0h39.171Zm-42 0L0 63.586V24.415L24.415 0h39.171Zm-42 0L0 21.586V0h21.586Z' fill='rgba(136,136,136,0.2)' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 1;
}

/* Gradient Overlay */
.cis-media-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 100%);
    z-index: 3;
    pointer-events: none;
}

/* Video/Image */
.cis-media-card__video,
.cis-media-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

/* ============================================
   Profile Info (inside card)
   ============================================ */
.cis-profile {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 4;
}

.cis-profile__image {
    width: 32px;
    height: 32px;
    border-radius: var(--cis-radius-sm);
    overflow: hidden;
    box-shadow: var(--cis-shadow-heavy);
    flex-shrink: 0;
}

.cis-profile__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cis-profile-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--cis-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cis-profile__verified {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cis-profile__verified svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Stats Badges
   ============================================ */
.cis-stat-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--cis-white);
    border: 1px solid var(--cis-border);
    border-radius: var(--cis-radius-md);
    box-shadow: var(--cis-shadow-soft);
    backdrop-filter: blur(5px);
    font-size: 14px;
    font-weight: 500;
    color: var(--cis-text-muted);
    white-space: nowrap;
    z-index: 10;
    transition: all 0.3s ease;
}

.cis-stat-badge:hover {
    transform: translateY(-2px);
    box-shadow:
            var(--cis-shadow-soft),
            0 8px 20px rgba(0, 0, 0, 0.08);
}

.cis-stat-badge__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cis-stat-badge__icon svg {
    width: 16px;
    height: 16px;
}

.cis-stat-badge__text {
    line-height: 1;
}

/* Badge Placements */
.cis-stat-badge--top-left {
    top: 20px;
    left: 0;
}

.cis-stat-badge--top-right {
    top: 20px;
    right: 0;
}

.cis-stat-badge--bottom-left {
    bottom: 80px;
    left: -20px;
}

.cis-stat-badge--bottom-right {
    bottom: 40px;
    right: -20px;
}

.cis-stat-badge--center-left {
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
}

.cis-stat-badge--center-right {
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
}

.cis-stat-badge--center-left:hover,
.cis-stat-badge--center-right:hover {
    transform: translateY(calc(-50% - 2px));
}

/* ============================================
   Animation States (Initial - before animation)
   ============================================ */
.cis-section[data-animate="true"] .cis-tag,
.cis-section[data-animate="true"] .cis-title,
.cis-section[data-animate="true"] .cis-description,
.cis-section[data-animate="true"] .cis-media-card,
.cis-section[data-animate="true"] .cis-stat-badge {
    opacity: 0;
    transform: translateY(30px);
}

.cis-section[data-animate="true"] .cis-stat-badge--center-left,
.cis-section[data-animate="true"] .cis-stat-badge--center-right {
    transform: translateY(-50%) translateX(-20px);
}

/* Animated state */
.cis-section[data-animate="true"].cis-animated .cis-tag,
.cis-section[data-animate="true"].cis-animated .cis-title,
.cis-section[data-animate="true"].cis-animated .cis-description,
.cis-section[data-animate="true"].cis-animated .cis-media-card,
.cis-section[data-animate="true"].cis-animated .cis-stat-badge {
    opacity: 1;
    transform: translateY(0);
}

.cis-section[data-animate="true"].cis-animated .cis-stat-badge--center-left,
.cis-section[data-animate="true"].cis-animated .cis-stat-badge--center-right {
    transform: translateY(-50%) translateX(0);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .cis-section {
        padding: 60px 40px;
    }

    .cis-container {
        gap: 40px;
    }

    .cis-media-card {
        max-width: 240px;
    }

    .cis-media-wrapper {
        min-height: 350px;
    }
}

@media (max-width: 900px) {
    .cis-container {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .cis-content-block--right {
        flex-direction: column-reverse;
    }

    .cis-media-wrapper {
        min-height: 450px;
        display: flex;
        justify-content: center;
    }

    .cis-media-cards {
        justify-content: center;
    }

    .cis-stat-badge--top-left {
        left: 10%;
    }

    .cis-stat-badge--top-right {
        right: 10%;
    }

    .cis-stat-badge--bottom-left {
        left: 5%;
    }

    .cis-stat-badge--bottom-right {
        right: 5%;
    }
}

@media (max-width: 600px) {
    .cis-section {
        padding: 40px 20px;
    }

    .cis-title {
        font-size: 24px;
    }

    .cis-description {
        font-size: 15px;
    }

    .cis-media-card {
        max-width: 200px;
    }

    .cis-media-cards--multiple .cis-media-card:nth-child(2) {
        margin-left: -40px;
        margin-top: 30px;
    }

    .cis-media-wrapper {
        min-height: 380px;
    }

    .cis-stat-badge {
        padding: 8px 12px;
        font-size: 12px;
    }

    .cis-stat-badge--center-left,
    .cis-stat-badge--center-right {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        margin-top: 10px;
    }
}

/* ============================================
   Hover Effects
   ============================================ */
.cis-media-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cis-media-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.cis-media-card:hover .cis-media-card__overlay {
    opacity: 0.8;
}

.cis-media-card__video,
.cis-media-card__image {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cis-media-card:hover .cis-media-card__video,
.cis-media-card:hover .cis-media-card__image {
    transform: scale(1.05);
}

/* ============================================
   Floating Animation for Badges
   ============================================ */
@keyframes cis-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes cis-float-center {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(calc(-50% - 6px)) translateX(0);
    }
}

.cis-stat-badge {
    animation: cis-float 4s ease-in-out infinite;
}

.cis-stat-badge:nth-child(2) {
    animation-delay: 0.5s;
}

.cis-stat-badge:nth-child(3) {
    animation-delay: 1s;
}

.cis-stat-badge:nth-child(4) {
    animation-delay: 1.5s;
}

.cis-stat-badge:nth-child(5) {
    animation-delay: 2s;
}

.cis-stat-badge--center-left,
.cis-stat-badge--center-right {
    animation: cis-float-center 4s ease-in-out infinite;
}

/* Pause animation on hover */
.cis-stat-badge:hover {
    animation-play-state: paused;
}

/* ============================================
   Dark Mode Support
   ============================================ */
@media (prefers-color-scheme: dark) {
    .cis-section.cis-dark-mode {
        --cis-white: #1c1c1c;
        --cis-text-dark: #f5f5f5;
        --cis-text-muted: #a0a0a0;
        --cis-border: #333333;
        --cis-card-bg: #2a2a2a;
    }
}

/* ============================================
   Elementor Editor Styles
   ============================================ */
.elementor-editor-active .cis-section[data-animate="true"] .cis-tag,
.elementor-editor-active .cis-section[data-animate="true"] .cis-title,
.elementor-editor-active .cis-section[data-animate="true"] .cis-description,
.elementor-editor-active .cis-section[data-animate="true"] .cis-media-card,
.elementor-editor-active .cis-section[data-animate="true"] .cis-stat-badge {
    opacity: 1;
    transform: none;
}

.elementor-editor-active .cis-section[data-animate="true"] .cis-stat-badge--center-left,
.elementor-editor-active .cis-section[data-animate="true"] .cis-stat-badge--center-right {
    transform: translateY(-50%);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .cis-section {
        padding: 20px;
    }

    .cis-stat-badge {
        animation: none;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .cis-media-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}