/* Reset & Variables */
:root {
    --primary: #b36b39; /* Bronze/Copper */
    --primary-dark: #8b4513;
    --secondary: #5d4037;
    --text-main: #3e2723;
    --text-sub: #6d4c41;
    --bg-gradient: linear-gradient(135deg, #2c221c 0%, #15100d 100%);
    --card-bg: #ffffff;
    --glass-border: rgba(179, 107, 57, 0.2);
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 30px 60px -12px rgba(179, 107, 57, 0.25);
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    overflow: hidden; /* Prevent scroll */
    perspective: 1000px; /* For 3D flip */
}

/* Background Animation */
.bg-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #d7ccc8;
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #8d6e63;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

/* Card Container */
.card-scene {
    width: 90%;
    max-width: 600px;
    height: 380px; /* Typical business card ratio approx 1.58, adjusted for content */
    position: relative;
}

.card-object {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-object.is-flipped {
    transform: rotateY(180deg);
}

/* Card Face Common Styles */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #ffffff 0%, #fff8f0 100%);
}

/* Front Design */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
}

.logo small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-sub);
    margin-left: 12px;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-sub);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.card-body {
    flex: 1;
    display: flex;
    align-items: center;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.avatar-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary), #e6b8a2);
    box-shadow: 0 8px 16px rgba(139, 69, 19, 0.2);
}

.avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    display: block;
}

.info-text .name {
    font-size: 2rem;
    font-weight: 800;
    margin: 10px 0 15px 0;
    color: var(--text-main);
}

.info-text .title {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0;
}

.divider {
    width: 40px;
    height: 3px;
    background: var(--primary);
    margin: 15px 0;
}

.info-text .slogan {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

.contact-row {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-sub);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-item i {
    color: var(--primary);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Buttons */
.btn-flip, .btn-call {
    padding: 10px 20px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-flip {
    background: var(--text-main);
    color: #fff;
}

.btn-flip:hover {
    background: var(--primary);
    transform: translateX(5px);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-sub);
    cursor: pointer;
    padding: 5px;
}

.btn-close:hover {
    color: var(--primary);
}

.btn-call {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(179, 107, 57, 0.3);
}

.btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(179, 107, 57, 0.4);
}

/* Back Design */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.service-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.icon-box {
    width: 40px;
    height: 40px;
    background: rgba(179, 107, 57, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.service-text h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: var(--text-main);
}

.service-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.qr-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sub);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.qr-placeholder:hover {
    color: var(--primary);
}

.qr-placeholder i {
    font-size: 1.5rem;
}

/* QR Overlay */
.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 10;
    transform: scale(0.95);
}

.qr-overlay.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.qr-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-box {
    width: 180px;
    height: 180px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

.qr-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qr-content p {
    margin: 0;
    color: var(--text-sub);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-qr-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: #fff;
    color: var(--text-sub);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.btn-qr-close:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: rotate(90deg);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    body {
        perspective: none;
    }

    .card-scene {
        height: auto;
        min-height: 90vh;
        width: 95%;
        max-width: 400px;
    }

    .card-face {
        padding: 25px 20px;
    }

    .card-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .logo {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .logo small {
        margin-left: 0;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .info-text .name {
        font-size: 1.8rem;
        margin: 10px 0;
    }

    .divider {
        margin: 15px auto;
    }

    .contact-row {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        align-items: center;
    }

    .card-footer {
        flex-direction: column;
        gap: 20px;
    }
    
    .btn-flip, .btn-call {
        width: 100%;
        justify-content: center;
    }
    
    .contact-item {
        justify-content: center;
    }

    .services-list {
        gap: 15px;
    }

    .service-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .qr-box {
        width: 150px;
        height: 150px;
    }
}

/* Orientation Prompt */
.orientation-prompt {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
}

.prompt-content i {
    font-size: 3rem;
    transform: rotate(90deg);
    animation: rotate-animation 1.5s ease-in-out infinite;
}

.prompt-content p {
    font-size: 1rem;
    max-width: 250px;
    line-height: 1.6;
}

@keyframes rotate-animation {
    0% { transform: rotate(90deg); }
    50% { transform: rotate(0deg); }
    100% { transform: rotate(90deg); }
}

@media (orientation: portrait) and (max-width: 767px) {
    .orientation-prompt {
        display: flex;
    }
    .card-scene {
        display: none;
    }
}
