/* Base */
body {
    font-family: 'Arial', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #87CEEB rgba(0, 0, 0, 0.1);
}
/* Custom Light Blue Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #87CEEB, #ADD8E6); /* Light Blue Gradient */
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ADD8E6, #B0E0E6); /* Lighter Blue on hover */
}
/* Slider Icon - Attractive */
#visitor-slider-icon {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #0077be, #d4af37, #8b0000); /* Ocean blue, turmeric yellow, blood red */
    color: white;
    padding: 15px 25px;
    border-radius: 50px 0 0 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
#visitor-slider-icon:hover {
    left: 0;
    border-radius: 0;
    transform: translateY(-50%) rotateY(10deg) scale(1.05); /* Enhanced 3D */
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}
.visitor-icon { font-size: 24px; }
#visitor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
#visitor-panel {
    position: fixed;
    left: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: linear-gradient(45deg, #0077be, #d4af37); /* Attractive form bg */
    box-shadow: 5px 0 20px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    color: white;
    scrollbar-width: thin;
    scrollbar-color: #87CEEB rgba(0, 0, 0, 0.1);
}
#visitor-panel.active { left: 0; }
#visitor-panel::-webkit-scrollbar {
    width: 8px;
}
#visitor-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
#visitor-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #87CEEB, #ADD8E6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#visitor-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ADD8E6, #B0E0E6);
}
.visitor-panel-header {
    background: linear-gradient(45deg, #8b0000, #d4af37); /* Header contrast */
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.visitor-panel-header h2 { margin: 0; font-size: 1.5em; font-weight: bold; }
.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s;
}
.close-btn:hover { background: rgba(255,255,255,0.3); }
#visitor-form {
    padding: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.9);
    font-size: 1em;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.mobile-input-group, .photo-input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#start-photo-btn, #capture-photo-btn {
    background: linear-gradient(45deg, #8b0000, #d4af37);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}
#start-photo-btn:hover {
    transform: scale(1.02);
}
#capture-photo-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    color: #333;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 18px;
    cursor: pointer;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
#capture-photo-btn:hover {
    transform: scale(1.1);
}
#photo-video {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
#photo-canvas {
    display: none;
}
.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #0077be, #8b0000);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: block;
    margin-top: 10px;
    position: relative;
    z-index: 5;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
}
.generate-btn:hover {
    transform: scale(1.05) rotateX(5deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.generate-btn:active {
    transform: scale(0.98);
}
#visitor-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 1002;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #87CEEB rgba(0, 0, 0, 0.1);
}
#visitor-preview::-webkit-scrollbar {
    width: 8px;
}
#visitor-preview::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
#visitor-preview::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #87CEEB, #ADD8E6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#visitor-preview::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ADD8E6, #B0E0E6);
}
.preview-header {
    padding: 15px 20px;
    background: linear-gradient(45deg, #0077be, #d4af37);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preview-header h3 { margin: 0; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.download-btn {
    background: linear-gradient(45deg, #8b0000, #d4af37);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}
.download-btn:hover { transform: scale(1.05); }
#card-container {
    padding: 20px;
    perspective: 1000px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    scrollbar-width: thin;
    scrollbar-color: #87CEEB rgba(0, 0, 0, 0.1);
}
#card-container::-webkit-scrollbar {
    width: 8px;
}
#card-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
#card-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #87CEEB, #ADD8E6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#card-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ADD8E6, #B0E0E6);
}
.visitor-card-3d { perspective: 1000px; }
.visitor-card {
    width: 450px; /* Wider for layout */
    height: 300px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0077be 0%, #d4af37 50%, #8b0000 100%); /* Multi-gradient: ocean blue, turmeric yellow, blood red */
    border-radius: 20px;
    padding: 0;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 4px 15px rgba(139,0,0,0.3);
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    color: #fff; /* High contrast white text */
    border: 3px solid rgba(255,255,255,0.2);
}
.visitor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 20px 20px 0 0;
}
.visitor-card:hover {
    transform: rotateY(10deg) rotateX(5deg) translateZ(20px);
}
.company-header {
    background: rgba(0,0,0,0.2);
    padding: 10px 20px;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}
.company-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}
.card-content {
    display: flex;
    height: calc(100% - 50px);
}
.card-text {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-field {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.card-field strong {
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
    color: #fff;
    min-width: 80px;
}
.card-field span {
    color: #f8f9fa;
    font-weight: 600;
}
.card-image {
    flex: 0 0 150px;
    padding: 20px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 2px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.1);
}
.card-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.no-photo {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.card-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 5px;
}
/* Updated Card Field Styles */
.field-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.field-label {
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    min-width: 80px;
    text-align: left;
}
.field-value {
    color: #f8f9fa;
    font-weight: 600;
    flex: 1;
    word-break: break-word;
}
/* Print-friendly styles - High contrast and clear */
@media print {
    .visitor-card {
        box-shadow: none !important;
        transform: none !important;
        border: 2px solid #000 !important;
        background: linear-gradient(135deg, #0077be 0%, #d4af37 50%, #8b0000 100%) !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        width: 100% !important;
        height: auto !important;
    }
    .card-field strong, .card-field span, .company-header h3 {
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
    }
    .card-image { border-left: 2px solid #000 !important; }
    #visitor-preview {
        box-shadow: none !important;
        position: static !important;
        transform: none !important;
        background: white !important;
    }
    .card-photo { border: 2px solid #000 !important; }
}
/* Mobile Devices Only */
@media (max-width: 768px) {
    /* Visitor Panel with Vertical Scroll */
    #visitor-panel {
        width: 100%;
        left: -100%;
        padding: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 1001;
    }
   
    #visitor-panel.active {
        left: 0;
    }
   
    .visitor-panel-header {
        padding: 15px;
        position: sticky;
        top: 0;
        background: linear-gradient(45deg, #8b0000, #d4af37);
        z-index: 10;
    }
   
    #visitor-form {
        padding: 15px;
        overflow-y: visible;
    }
   
    /* Visitor Preview with Vertical Scroll */
    #visitor-preview {
        max-width: 95%;
        max-height: 95vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        overflow-y: auto;
        z-index: 1002;
    }
   
    .preview-header {
        padding: 10px 15px;
        position: sticky;
        top: 0;
        background: linear-gradient(45deg, #0077be, #d4af37);
        z-index: 10;
    }
   
    #card-container {
        padding: 10px;
        overflow-y: auto;
        max-height: calc(100vh - 150px);
    }
   
    /* Mobile specific styles */
    #visitor-slider-icon {
        left: 10px;
        padding: 12px 20px;
        top: 20px;
        transform: none;
        border-radius: 25px;
        z-index: 1003;
    }
   
    .visitor-panel-header h2 {
        font-size: 1.2em;
    }
   
    .form-group {
        margin-bottom: 5px;
    }
   
    .form-group label {
        font-size: 0.9em;
    }
   
    .form-group input {
        padding: 10px;
        font-size: 16px;
    }
   
    .mobile-input-group, .photo-input-group {
        gap: 0;
        position: relative;
    }
   
    #start-photo-btn {
        padding: 10px;
        font-size: 14px;
    }
   
    #capture-photo-btn {
        position: static;
        display: block;
        width: 100%;
        max-width: 120px;
        margin: 0 auto 0;
        background: linear-gradient(45deg, #8b0000, #d4af37);
        color: white;
        border: none;
        border-radius: 8px;
        height: auto;
        padding: 12px;
        font-size: 16px;
        z-index: auto;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
   
    #photo-video {
        height: 200px !important;
        width: 100% !important;
        border-radius: 8px;
    }
   
    #photo-preview {
        height: 200px !important;
        width: 100% !important;
        object-fit: cover;
        border-radius: 8px;
        display: block !important;
    }
   
    .generate-btn {
        padding: 15px 20px;
        font-size: 18px;
        margin-top: 0;
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 1000 !important;
        margin-bottom: 20px;
        touch-action: manipulation;
        min-height: 50px;
        line-height: 1.2;
        white-space: normal;
        word-wrap: break-word;
        text-align: center;
        box-sizing: border-box;
    }
   
    .preview-header h3 {
        font-size: 1.1em;
    }
   
    .download-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
   
    .visitor-card {
        width: 100%;
        height: auto;
        min-height: 350px;
        flex-direction: column;
        padding: 10px;
        margin-bottom: 20px;
    }
   
    .card-content {
        flex-direction: column;
        height: auto;
    }
   
    .card-text {
        padding: 15px;
        order: 1;
    }
   
    .card-field {
        font-size: 12px;
        margin-bottom: 6px;
    }
   
    .card-field strong {
        font-size: 14px;
        min-width: auto;
        display: block;
        margin-bottom: 2px;
    }
   
    .card-image {
        flex: none;
        border-left: none;
        border-top: 2px solid rgba(255,255,255,0.2);
        order: 2;
        padding: 10px;
        min-height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
   
    .card-photo, .no-photo {
        width: 120px;
        height: 120px;
        max-width: 120px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }
   
    .company-header {
        padding: 8px 15px;
    }
   
    .company-header h3 {
        font-size: 16px;
    }
   
    .card-footer {
        font-size: 10px;
        padding-top: 3px;
    }
   
    /* Mobile specific scroll improvements */
    .field-row {
        flex-direction: row; /* Label के सामने value दिखाने के लिए row */
        align-items: center;
        gap: 5px;
    }
   
    .field-label {
        min-width: auto;
        font-size: 14px;
    }
   
    .field-value {
        font-size: 13px;
        width: auto;
    }
   
    /* Smooth scrolling for mobile */
    #visitor-panel,
    #visitor-preview,
    #card-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}
@media (max-width: 480px) {
    #visitor-form {
        padding: 10px;
    }
   
    .form-group {
        margin-bottom: 3px;
    }
   
    .form-group input {
        padding: 8px;
    }
   
    #photo-video, #photo-preview {
        height: 180px !important;
    }
   
    #capture-photo-btn {
        max-width: 100px;
        padding: 10px;
        font-size: 14px;
    }
   
    .generate-btn {
        padding: 12px 16px;
        font-size: 16px;
        margin-bottom: 15px;
        white-space: normal;
        word-wrap: break-word;
    }
   
    .card-text {
        padding: 10px;
    }
   
    .card-field {
        font-size: 11px;
    }
   
    .card-field strong {
        font-size: 13px;
    }
   
    .card-image {
        padding: 8px;
    }
   
    .card-photo, .no-photo {
        width: 100px;
        height: 100px;
        max-width: 100px;
    }
   
    .field-label {
        font-size: 13px;
    }
   
    .field-value {
        font-size: 12px;
    }
}