/* ============================================================
   3D ID CARD MODAL - PT Indo OceanCrew Services
   Premium animated modal with 3D tilt effect
   ============================================================ */

/* ===== MODAL OVERLAY ===== */
.idcard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.idcard-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== CLOSE BUTTON ===== */
.idcard-close {
    position: absolute;
    top: 24px;
    right: 32px;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.idcard-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: rotate(90deg) scale(1.1);
}

/* ===== ID CARD ===== */
.idcard-3d {
    width: 340px;
    height: 500px;
    background: linear-gradient(135deg, #023e8a, #0077b6, #00b4d8);
    border-radius: 24px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: white;
    padding: 28px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;

    /* Entry animation */
    transform: scale(0.5) rotateY(-30deg);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.4s ease;
}

/* Subtle pattern overlay */
.idcard-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 24px;
}

/* Glare effect */
.idcard-3d::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.12) 45%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 55%);
    pointer-events: none;
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.idcard-3d:hover::after {
    opacity: 1;
}

.idcard-overlay.active .idcard-3d {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
}

/* ===== CARD HEADER ===== */
.idcard-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 24px;
    transform: translateZ(20px);
    position: relative;
    z-index: 1;
}

.idcard-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: white;
    padding: 2px;
    margin-right: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.idcard-company {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: left;
    line-height: 1.35;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== PROFILE PHOTO ===== */
.idcard-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    object-fit: cover;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.35),
        0 0 0 6px rgba(255, 255, 255, 0.1);
    transform: translateZ(60px);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.idcard-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
}

/* ===== NAME & ROLE ===== */
.idcard-name {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    transform: translateZ(40px);
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.idcard-position {
    font-family: 'Inter', 'Poppins', sans-serif;
    font-size: 13px;
    color: #caf0f8;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transform: translateZ(30px);
    position: relative;
    z-index: 1;
}

.idcard-division {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: rgba(202, 240, 248, 0.7);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateZ(25px);
    position: relative;
    z-index: 1;
}

/* ===== ID NUMBER BADGE ===== */
.idcard-id {
    margin-top: auto;
    font-family: 'Inter', monospace;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    padding: 8px 20px;
    border-radius: 24px;
    transform: translateZ(20px);
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

/* ===== ORG CHART AVATAR WITH PHOTO ===== */
.oc-node .oc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.oc-node .oc-avatar.has-photo {
    padding: 0;
    overflow: hidden;
    font-size: 0;
    background: #e2e8f0;
}

.oc-node:hover .oc-avatar {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

/* Pulse highlight when clickable */
.oc-node {
    position: relative;
}

.oc-node::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 13px;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.oc-node:hover::after {
    border-color: rgba(0, 180, 216, 0.35);
    animation: idcard-pulse 1.5s ease-in-out infinite;
}

@keyframes idcard-pulse {

    0%,
    100% {
        border-color: rgba(0, 180, 216, 0.15);
    }

    50% {
        border-color: rgba(0, 180, 216, 0.45);
    }
}

/* ===== CLICK HINT ===== */
.oc-node .click-hint {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #94a3b8;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
}

.oc-node:hover .click-hint {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .idcard-overlay {
        padding: 20px;
        align-items: center;
    }

    .idcard-3d {
        width: 290px;
        height: auto;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
        padding: 22px 18px;
    }

    .idcard-photo {
        width: 130px;
        height: 130px;
    }

    .idcard-name {
        font-size: 19px;
    }

    .idcard-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 400px) {
    .idcard-3d {
        width: 260px;
        padding: 18px 14px;
    }

    .idcard-photo {
        width: 110px;
        height: 110px;
        margin-bottom: 16px;
    }

    .idcard-name {
        font-size: 17px;
    }

    .idcard-position {
        font-size: 11px;
    }

    .idcard-header {
        margin-bottom: 18px;
    }

    .idcard-logo {
        width: 40px;
        height: 40px;
    }

    .idcard-company {
        font-size: 11px;
    }
}

@media (max-height: 600px) {
    .idcard-3d {
        height: auto;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }

    .idcard-photo {
        width: 100px;
        height: 100px;
        margin-bottom: 12px;
    }

    .idcard-header {
        margin-bottom: 14px;
    }
}