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

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

.container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    width: 340px;
    height: 520px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

.card-back {
    background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
}

/* Header Section */
.card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.logo-icon {
    width: 50px;
    height: 50px;
    border: 3px solid #4a9fd8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #4a9fd8;
    background: rgba(74, 159, 216, 0.1);
}

.logo-icon.gold {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.company-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
}

.company-info h1 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 3px;
    letter-spacing: 1px;
}

.card-back .company-info h1 {
    color: #1a3a52;
}

.company-info p {
    font-size: 11px;
    color: #aaa;
}

.card-back .company-info p {
    color: #666;
}

/* Decorative Wave */
.decorative-wave {
    position: absolute;
    top: 80px;
    left: -50px;
    right: -50px;
    height: 150px;
    background: linear-gradient(90deg, #1e5a8e 0%, #4a9fd8 50%, #d4af37 100%);
    border-radius: 50%;
    opacity: 0.3;
    z-index: 1;
}

/* Photo Container */
.photo-container {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    position: relative;
    z-index: 2;
}

.photo-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9fd8 0%, #1e5a8e 100%);
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f0f0;
}

.employee-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Employee Info */
.employee-info {
    padding: 20px 30px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.employee-name {
    font-size: 22px;
    color: #4a9fd8;
    margin-bottom: 5px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.employee-position {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
}

.details {
    text-align: left;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 13px;
}

.detail-row .label {
    color: #4a9fd8;
    font-weight: bold;
    min-width: 70px;
}

.detail-row .value {
    color: #ddd;
    margin-left: 5px;
}

.barcode {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.barcode svg {
    width: 100%;
    max-width: 200px;
    height: 40px;
}

/* Back Card Styles */
.terms-section {
    padding: 20px 30px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.terms-section h3 {
    font-size: 16px;
    color: #1a3a52;
    margin-bottom: 15px;
    font-weight: bold;
}

.terms-list {
    list-style: none;
    margin-bottom: 20px;
}

.terms-list li {
    font-size: 11px;
    color: #333;
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
}

.terms-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #1e5a8e;
    border-radius: 50%;
}

.signature-section {
    margin-top: 20px;
}

.signature {
    width: 120px;
    height: 40px;
    margin-bottom: 5px;
}

.signature svg {
    width: 100%;
    height: 100%;
}

.signature-label {
    font-size: 11px;
    color: #666;
}

/* Decorative Wave Back */
.decorative-wave-back {
    position: absolute;
    bottom: 80px;
    left: -50px;
    right: -50px;
    height: 200px;
    background: linear-gradient(90deg, #1e5a8e 0%, #4a9fd8 50%, #d4af37 100%);
    border-radius: 50%;
    opacity: 0.8;
    z-index: 1;
}

/* Footer Info */
.footer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    border-radius: 0 0 20px 20px;
}

.dates {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-item {
    font-size: 10px;
    color: #fff;
    display: flex;
    gap: 5px;
}

.qr-code {
    width: 60px;
    height: 60px;
    background: #fff;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-code-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 30px;
    }
    
    .card {
        width: 100%;
        max-width: 340px;
    }
}

@media print {
    body {
        background: #fff;
        margin: 0;
        padding: 0;
    }
    
    .back-link,
    .print-btn {
        display: none !important;
    }
    
    .container {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .card {
        width: 100%;
        max-width: 340px;
        height: 520px;
        box-shadow: none;
        margin: 0 auto 20px auto;
        page-break-after: always;
    }
    
    .card-back {
        margin-top: 0;
    }
}



@page {
    size: 85.6mm 53.98mm; /* Standard ID card size */
    margin: 0;
}

@media print {
    html, body {
        width: 85.6mm;
        height: 53.98mm;
        overflow: hidden;
    }
    .container {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
    }
    .card {
        width: 85.6mm;
        height: 53.98mm;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        page-break-after: avoid;
        position: relative;
        transform: scale(1) !important; /* Ensure no scaling */
    }
    .card-front, .card-back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
    }
    .card-back {
        /* This will be handled by JavaScript for proper two-sided printing */
        display: none;
    }
}

