/* ============================================================
   Custom Element Page Plugin – Frontend Styles v2
   ============================================================ */

/* ---------- Reset ---------- */
.cep-section *,
.cep-section *::before,
.cep-section *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- Section ---------- */
.cep-section {
    --cep-theme:    #7c3aed;
    --cep-bg:       #1a0533;
    --cep-orange:   #f97316;
    --cep-pink:     #e94e8a;
    --cep-card-bg:  rgba(43, 13, 90, 0.95);
    background: linear-gradient(135deg, var(--cep-bg) 0%, #2d0a5e 40%, #1a0840 70%, #0d0326 100%);
    padding: 64px 20px 72px;
    font-family: 'Segoe UI', Arial, sans-serif;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ---------- Filter overlays ---------- */
.cep-filter--gradient {
    background: linear-gradient(135deg, var(--cep-bg) 0%, #4a0070 50%, var(--cep-bg) 100%) !important;
}

.cep-filter--glassmorphism {
    background: linear-gradient(135deg, var(--cep-bg) 0%, #3a0060 100%) !important;
}

.cep-filter--glassmorphism .cep-card {
    background: rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.cep-filter--dark-mode {
    background: linear-gradient(160deg, #050510 0%, #0d0d1a 100%) !important;
}

.cep-filter--dark-mode .cep-card {
    background: linear-gradient(160deg, #111122 0%, #0a0a18 100%) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* ---------- Container ---------- */
.cep-container {
    max-width: 1160px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    align-items: stretch;
}

/* ---------- Card ---------- */
.cep-card {
    background: linear-gradient(160deg, #2b0d5a 0%, #1e0a44 60%, #15083a 100%);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    perspective: 800px;
}

.cep-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

/* ---------- Card Image Wrap ---------- */
.cep-card__image-wrap {
    flex-shrink: 0;
    height: 280px;
    position: relative;
    overflow: hidden;
}

.cep-card__image {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Photo image */
.cep-card__image--photo {
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.cep-card__image--photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 10, 68, 0.85) 0%, transparent 55%);
    pointer-events: none;
}

/* Icon overlay on photo */
.cep-card__icon-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cep-card__icon-overlay img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Placeholder */
.cep-card__image--placeholder {
    background: radial-gradient(ellipse at 50% 40%, rgba(120, 40, 200, 0.45) 0%, transparent 70%);
    flex-direction: column;
    gap: 12px;
}

.cep-placeholder-graphic {
    opacity: 0.7;
}

.cep-placeholder-graphic svg {
    width: 120px;
    height: 120px;
}

.cep-placeholder-icon {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.2));
}

/* ---------- Floating decorative elements ---------- */
.cep-float {
    position: absolute;
    z-index: 3;
    animation: cep-float-anim 3s ease-in-out infinite;
    pointer-events: none;
}

.cep-float--heart {
    color: #e91e8c;
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(233, 30, 140, 0.7));
}

.cep-float--star {
    color: #f1c40f;
    font-size: 20px;
    filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.8));
}

@keyframes cep-float-anim {
    0%, 100% { transform: translateY(0)    rotate(0deg);   }
    33%       { transform: translateY(-9px) rotate(-6deg); }
    66%       { transform: translateY(-4px) rotate(5deg);  }
}

/* ---------- Card Body ---------- */
.cep-card__body {
    padding: 28px 28px 32px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ---------- Title ---------- */
.cep-card__title {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

/* ---------- Wave ---------- */
.cep-card__wave {
    width: 100%;
    height: 18px;
    margin-bottom: 16px;
    overflow: visible;
}

.cep-card__wave svg {
    width: 100%;
    height: 18px;
    display: block;
}

/* ---------- Description ---------- */
.cep-card__desc {
    font-size: 14.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 28px;
    flex: 1;
}

/* ---------- Button ---------- */
.cep-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    padding: 14px 26px;
    border-radius: 8px;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
    box-shadow: 0 4px 18px rgba(249, 115, 22, 0.45);
    align-self: flex-start;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cep-card__btn:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.6);
    color: #fff;
    text-decoration: none;
}

.cep-card__btn:active {
    transform: translateY(0);
}

.cep-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    flex-shrink: 0;
}

.cep-btn-icon svg {
    width: 13px;
    height: 13px;
}

.cep-btn-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* ---------- No-cards state ---------- */
.cep-no-cards {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */

/* Hidden state (before JS applies class) */
.cep-card--hidden {
    opacity: 0;
}

/* Slide Up */
.cep-anim--slide-up.cep-card--hidden   { transform: translateY(50px); }
.cep-anim--slide-up.cep-card--visible  {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 3D Flip */
.cep-anim--flip-3d.cep-card--hidden    { transform: rotateY(-80deg); opacity: 0; }
.cep-anim--flip-3d.cep-card--visible   {
    opacity: 1;
    transform: rotateY(0deg);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Bounce */
.cep-anim--bounce.cep-card--hidden     { transform: scale(0.5); opacity: 0; }
.cep-anim--bounce.cep-card--visible    {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 2.0, 0.64, 1);
}

/* Zoom In */
.cep-anim--zoom-in.cep-card--hidden    { transform: scale(0.75); opacity: 0; }
.cep-anim--zoom-in.cep-card--visible   {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Fade */
.cep-anim--fade.cep-card--hidden       { opacity: 0; }
.cep-anim--fade.cep-card--visible      {
    opacity: 1;
    transition: opacity 0.7s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {
    .cep-section {
        padding: 44px 16px 52px;
    }

    .cep-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cep-card__image-wrap { height: 240px; }
    .cep-card__body       { padding: 22px 20px 26px; }
    .cep-card__title      { font-size: 22px; }

    .cep-card__btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .cep-card__image-wrap { height: 200px; }
    .cep-card__title      { font-size: 19px; }
    .cep-card__desc       { font-size: 13.5px; }
    .cep-card__btn        { font-size: 14px; padding: 12px 20px; }
}

/* ============================================================
   FLOATING EFFECTS & DYNAMIC STYLES
   All @keyframes, background, text color, animation, and filter
   rules are generated dynamically in PHP via cep_generate_inline_css()
   and injected as wp_add_inline_style — no static classes needed here.
   ============================================================ */
