* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    min-height: 100vh;
    overflow: hidden;
    cursor: default;
}

/* Scene container for 3D perspective */
.scene {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    perspective: 1500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    transform-style: preserve-3d;
    width: 90%;
    max-width: 800px;
}

/* Main profile card with 3D layers */
.profile-card {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: rotateX(0deg) rotateY(0deg);
}

/* 3D Layers for depth effect */
.card-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.layer-1 {
    transform: translateZ(-20px) scale(0.98);
    opacity: 0.5;
    background: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 100%);
}

.layer-2 {
    transform: translateZ(-40px) scale(0.96);
    opacity: 0.3;
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);
}

.layer-3 {
    transform: translateZ(-60px) scale(0.94);
    opacity: 0.2;
    background: linear-gradient(135deg, #050505 0%, #0f0f0f 100%);
}

/* Main card content */
.card-content {
    position: relative;
    background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 50%, #1e1e1e 100%);
    border-radius: 25px;
    padding: 50px;
    display: flex;
    align-items: center;
    gap: 50px;
    transform: translateZ(0);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

/* Corner highlights for 3D effect */
.corner {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.corner-tl {
    top: -20px;
    left: -20px;
    transform: translateZ(50px);
}

.corner-tr {
    top: -20px;
    right: -20px;
    transform: translateZ(50px);
}

.corner-bl {
    bottom: -20px;
    left: -20px;
    transform: translateZ(50px);
}

.corner-br {
    bottom: -20px;
    right: -20px;
    transform: translateZ(50px);
}

.profile-card:hover .corner {
    opacity: 1;
}

/* Profile image with 3D effect */
.profile-image-container {
    position: relative;
    transform: translateZ(30px);
    transform-style: preserve-3d;
}

.image-border {
    position: absolute;
    inset: -5px;
    background: linear-gradient(45deg, #666, #999, #666);
    border-radius: 50%;
    transform: translateZ(-10px);
    animation: rotate 20s linear infinite;
}

/* ปิด animation สำหรับ GIF */
.profile-image[src*=".gif"] ~ .image-border {
    animation: rotate 30s linear infinite;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ff6b6b);
}

@keyframes rotate {
    from { transform: translateZ(-10px) rotate(0deg); }
    to { transform: translateZ(-10px) rotate(360deg); }
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* ป้องกัน GIF กระตุก */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* เอฟเฟกต์พิเศษสำหรับ GIF */
.profile-image[src*=".gif"] {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 50px rgba(255, 255, 255, 0.1);
}

.image-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translateZ(-20px);
    filter: blur(20px);
    opacity: 0.5;
}

/* เพิ่ม glow effect สำหรับ GIF */
.profile-image[src*=".gif"] ~ .image-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 0.3;
        transform: translateZ(-20px) scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: translateZ(-20px) scale(1.1);
    }
}

/* Profile info */
.profile-info {
    flex: 1;
    transform: translateZ(20px);
}

.name {
    font-family: 'Kanit', sans-serif;
    font-size: 36px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.name::before {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 2px;
    color: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.title {
    font-family: 'Mitr', sans-serif;
    font-size: 20px;
    color: #888;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.bio {
    font-family: 'Prompt', sans-serif;
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 35px;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* Social links with 3D effect */
.social-links {
    display: flex;
    gap: 20px;
    transform: translateZ(40px);
}

.social-link {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.social-icon {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s ease;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.social-link:hover .social-icon::before {
    transform: translateX(100%);
}

.social-link:hover {
    transform: translateZ(20px) translateY(-5px) rotateX(-10deg);
}

.social-link:hover .social-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 10px 30px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Special hover effect for LINE - green glow */
.social-link[data-social="line"]:hover .social-icon {
    background: rgba(0, 195, 0, 0.1);
    border-color: rgba(0, 195, 0, 0.3);
    box-shadow: 
        0 10px 30px rgba(0, 195, 0, 0.3),
        inset 0 1px 0 rgba(0, 195, 0, 0.2);
}

.social-link[data-social="line"]:hover svg {
    fill: #00c300;
}

.social-link svg {
    width: 24px;
    height: 24px;
    fill: #ccc;
    transition: all 0.3s ease;
    z-index: 1;
}

.social-link:hover svg {
    fill: #fff;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Tooltip */
.social-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateZ(20px);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.social-link:hover .social-tooltip {
    opacity: 1;
}

/* Particles background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .scene {
        padding: 20px 10px;
    }
    
    .card-content {
        flex-direction: column;
        text-align: center;
        padding: 40px 25px;
        gap: 30px;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .name {
        font-size: 28px;
    }
    
    .title {
        font-size: 18px;
    }
    
    .bio {
        font-size: 15px;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }
    
    .image-border {
        inset: -4px;
    }
    
    .datetime-container {
        bottom: 15px;
        right: 15px;
        transform: translateZ(25px) scale(0.85);
    }
    
    .datetime-container:hover {
        transform: translateZ(30px) scale(0.9);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .container {
        max-width: 95%;
    }
    
    .card-content {
        padding: 35px 20px;
        gap: 25px;
    }
    
    .name {
        font-size: 24px;
    }
    
    .title {
        font-size: 16px;
        letter-spacing: 0.5px;
    }
    
    .bio {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    .social-link svg {
        width: 20px;
        height: 20px;
    }
    
    .datetime-container {
        transform: translateZ(25px) scale(0.8);
    }
    
    .datetime-icon {
        width: 28px;
        height: 28px;
    }
    
    .datetime-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .date {
        font-size: 10px;
    }
    
    .time {
        font-size: 13px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .card-content {
        padding: 30px 15px;
    }
    
    .name {
        font-size: 22px;
    }
    
    .title {
        font-size: 15px;
    }
    
    .bio {
        font-size: 13px;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .social-links {
        gap: 12px;
    }
    
    .social-link {
        width: 42px;
        height: 42px;
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .scene {
        padding: 10px;
    }
    
    .card-content {
        flex-direction: row;
        padding: 25px 30px;
        gap: 30px;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .name {
        font-size: 24px;
    }
    
    .bio {
        margin-bottom: 20px;
    }
    
    .datetime-container {
        transform: translateZ(25px) scale(0.75);
    }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
    
    .card-content {
        padding: 45px;
        gap: 40px;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
}

/* Safe area for notch devices */
@supports (padding: max(0px)) {
    .scene {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
    .social-link:active {
        transform: scale(0.95);
    }
    
    .profile-card {
        /* Disable hover tilt on touch devices */
        transition: transform 0.3s ease;
    }
}

/* DateTime Display */
.datetime-container {
    position: absolute;
    bottom: 18px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Prompt', sans-serif;
    color: rgba(255, 255, 255, 0.6);
    transform: translateZ(25px) scale(0.92);
    transition: all 0.3s ease;
}

.datetime-container:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateZ(30px) scale(0.97);
}

.datetime-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.datetime-icon svg {
    color: #888;
    transition: all 0.3s ease;
}

.datetime-container:hover .datetime-icon svg {
    color: #fff;
    transform: rotate(360deg);
}

.datetime-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.date {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.time {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* Glowing effect for time */
@keyframes time-glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
}

.time {
    animation: time-glow 2s ease-in-out infinite;
}