/* ================================================
   UreTech 3D Card Widget
   Business card with flip animation
   ================================================ */

/* --- Container --- */
.ut-card3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 450px;
    max-width: 100%;
    margin: 0 auto;
    --perspective: 1200px;
}

/* --- 3D Scene --- */
.ut-card3d__scene {
    width: 100%;
    perspective: var(--perspective);
    cursor: default;
    /* Isolate 3D context so it doesn't overlap the button */
    position: relative;
    z-index: 1;
}

.ut-card3d__scene.is-dragging {
    cursor: grabbing;
}

.ut-card3d__card {
    position: relative;
    width: 100%;
    padding-bottom: calc(100% / var(--card-ratio, 1.586));
    transform-style: preserve-3d;
    will-change: transform;
    /* transition controlled by JS applyTransform() */
}

/* transition classes removed — JS manages transitions */

/* Flip state is handled entirely via inline style.transform in JS */

/* --- Faces --- */
.ut-card3d__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.ut-card3d__back {
    transform: rotateY(180deg);
}

/* Shadow */
.ut-card3d.has-shadow .ut-card3d__face {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(234, 136, 222, 0.06);
}

/* Glassmorphism border */
.ut-card3d.has-border .ut-card3d__face {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Image --- */
.ut-card3d__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* --- Text Content --- */
.ut-card3d__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 10%;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Image + text: overlay mode */
.ut-card3d__face:has(.ut-card3d__img) .ut-card3d__content {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    justify-content: flex-end;
}

.ut-card3d__title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.2;
}

.ut-card3d__text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    white-space: pre-line;
}

/* --- Flip Button --- */
.ut-card3d__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--btn-bg, rgba(234, 136, 222, 0.15));
    color: var(--btn-color, #EA88DE);
    border: 1px solid var(--btn-border, rgba(234, 136, 222, 0.3));
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none;
    user-select: none;
    /* Stay above 3D card context */
    position: relative;
    z-index: 10;
}

.ut-card3d__btn:hover {
    background: rgba(234, 136, 222, 0.25);
    border-color: rgba(234, 136, 222, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(234, 136, 222, 0.15);
}

.ut-card3d__btn:active {
    transform: translateY(0);
}

.ut-card3d__btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Shine / Light Reflection --- */
.ut-card3d__shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- Hover tilt hint (subtle) --- */
.ut-card3d__scene {
    transition: transform 0.15s ease;
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .ure-card3d { min-height: 500px; }
  .ure-card3d__grid { gap: 16px; }
  .ure-card3d__item { padding: 20px 16px; }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .ut-card3d {
        width: 100% !important;
    }
    .ut-card3d__content {
        padding: 8%;
    }
    .ut-card3d__title {
        font-size: 18px;
    }
    .ut-card3d__text {
        font-size: 12px;
    }
    .ut-card3d__btn {
        font-size: 12px;
        padding: 8px 18px;
    }
}
