* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

.card-wrapper {
    perspective: 1000px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.business-card {
    width: 350px;
    height: 550px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
}

.card-front::-webkit-scrollbar {
    display: none; /* <-- Ini yang menyembunyikan scrollbar */
}

.card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Menambahkan scroll jika konten terlalu panjang */
}

.card-back {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    transform: rotateY(180deg);
    padding: 35px 30px;
    color: white;
    display: flex;
    flex-direction: column;
}

/* Front Card Styles */
.card-header {
    text-align: center;
    margin-bottom: 25px;
}

.profile-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 18px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border: 3px solid white;
    background: #667eea;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #667eea;
}

.name {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.title {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: 500;
}

.card-content {
    flex: 1; /* Memberikan ruang fleksibel untuk konten */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Mendistribusikan ruang antar elemen */
    margin-bottom: 20px; /* Memberikan ruang untuk footer */
}

.info-section {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 22px;
    border-left: 4px solid #667eea;
}

.info-section h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profession {
    color: #3498db;
    font-weight: 600;
    font-size: 14px;
}

.contact-info {
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.3s ease;
}

.contact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-item:hover {
    background: #f8f9fa;
    padding-left: 8px;
}

.contact-item i {
    min-width: 28px;
    color: #667eea;
    font-size: 16px;
}

.contact-text {
    color: #2c3e50;
    font-size: 14px;
    flex: 1;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    padding: 15px 0 10px;
}

.social-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

.social-icon:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.55);
}

.social-icon i {
    font-size: 17px;
    line-height: 1;
}

.social-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 1000;
}

.social-icon:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: -37px;
}

/* FIX: Footer yang terlihat dengan baik */
.card-footer {
    margin-top: 20px; /* Memberikan ruang yang cukup */
    padding-top: 18px;
    border-top: 2px solid #ecf0f1;
    flex-shrink: 0; /* Mencegah footer menyusut */
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.skill-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease;
}

.skill-tag:hover {
    transform: scale(1.1);
}

/* Back Card Styles */
.back-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.back-content h2 {
    font-size: 22px;
    margin-bottom: 18px;
    text-align: center;
}

.back-content p {
    line-height: 1.7;
    margin-bottom: 28px;
    text-align: center;
    font-size: 15px;
}

.qr-section {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.qr-placeholder {
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed rgba(255, 255, 255, 0.35);
}

.qr-placeholder i {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.qr-placeholder p {
    font-size: 12px;
    opacity: 0.85;
}

.back-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.back-footer p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-flip, .btn-download {
    padding: 11px 28px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.btn-flip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-flip:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 22px rgba(102, 126, 234, 0.45);
}

.btn-download {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-download:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

/* Download Info */
.download-info {
    margin-top: 22px;
}

.download-info p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.22);
    padding: 9px 22px;
    border-radius: 25px;
    display: inline-block;
    line-height: 1.4;
}

.download-info i {
    margin-right: 7px;
    color: #ffd700;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    margin-top: 18px;
    min-height: 45px;
}

.loading.show {
    display: block;
    animation: pulse 1.5s infinite;
}

.loading-spinner {
    border: 3.5px solid rgba(255, 255, 255, 0.3);
    border-top: 3.5px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Success Message */
.success-message {
    display: none;
    background: rgba(40, 167, 69, 0.92);
    color: white;
    padding: 10px 22px;
    border-radius: 25px;
    text-align: center;
    margin: 15px auto 0;
    max-width: 350px;
    animation: slideDown 0.4s ease;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message.show {
    display: block;
}

/* Error Message */
.error-message {
    display: none;
    background: rgba(220, 53, 69, 0.92);
    color: white;
    padding: 10px 22px;
    border-radius: 25px;
    text-align: center;
    margin: 15px auto 0;
    max-width: 350px;
    animation: slideDown 0.4s ease;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.error-message.show {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-front, .card-back {
    animation: fadeIn 0.6s ease-out;
}

/* Hover Effects */
.business-card:hover {
    transform: scale(1.025);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

/* Responsive Design */
@media (max-width: 768px) {
    .business-card {
        width: 310px;
        height: 510px;
    }
    
    .card-front, .card-back {
        padding: 30px 25px;
    }
    
    .profile-img {
        width: 100px;
        height: 100px;
    }
    
    .profile-img img {
        width: 100%;
        height: 100%;
    }
    
    .name {
        font-size: 23px;
    }
    
    .controls {
        flex-direction: column;
        width: 310px;
        margin-top: 20px;
    }
    
    .btn-flip, .btn-download {
        width: 100%;
        justify-content: center;
    }
    
    .download-info {
        width: 310px;
    }
    
    .social-links {
        gap: 12px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
    
    .social-icon i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .business-card {
        width: 290px;
        height: 480px;
    }
    
    .card-front, .card-back {
        padding: 28px 22px;
    }
    
    .name {
        font-size: 21px;
    }
    
    .controls {
        width: 290px;
    }
    
    .download-info {
        width: 290px;
        font-size: 13px;
    }
    
    .social-links {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .social-icon {
        width: 38px;
        height: 38px;
    }
    
    .qr-placeholder {
        width: 130px;
        height: 130px;
    }
}