*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Poppins', 'Segoe UI', sans-serif;
}

/* Body */
body{
    min-height:100vh;
    background:#f3f2f2;
    display:flex;
    flex-direction: column;
    justify-content:flex-start;
    align-items:center;
    padding:20px;
}

/* Navigation Bar - FIXED */
.nav-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    width: 100%;
    padding: 10px 0;
}

.nav-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.nav-btn.home { 
    background: #6c757d; 
    color: white; 
}

.nav-btn.home:hover { 
    background: #5a6268; 
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(108,117,125,0.3); 
}

.nav-btn.visitors { 
    background: #8d9195; 
    color: white; 
}

.nav-btn.visitors:hover { 
    background: #7a7f83; 
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(141,145,149,0.3); 
}

.nav-btn.exhibitors { 
    background: #1f305c;
    color: white; 
}

.nav-btn.exhibitors:hover { 
    background: #2a3f7a;
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(31,48,92,0.3); 
}

/* Header Styles */
header{
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    width: 100%;
}

header img{
    max-width: 150px;
    height: auto;
    margin-bottom: 10px;
}

header h1{
    font-size: 28px;
    color: #223351;
    font-weight: 600;
}

/* Main Container */
.container{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Panel Cards */
.panel{
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 280px;
}

.panel:hover{
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.panel h2{
    color: #223351;
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 600;
}

.panel button{
    background: #223351;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.panel button:hover{
    background: #2c405c;
    transform: scale(1.04);
}

/* Wrapper */
.main-wrapper, .wrapper{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:50px;
    width:100%;
    height:100%;
    max-width:1200px;
}

/* Left: Card Preview */
.card-preview{
    width:400px;
    height:560px;
    border-radius:20px;
    background-size:cover;
    background-position:center;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    box-shadow:0 20px 50px rgba(0,0,0,0.15);
}

.card-text{
    text-align:center;
    font-weight:bold;
    font-size:22px;
    margin-top:120px;
    background:rgba(255,255,255,0);
    padding:15px 20px;
    border-radius:12px;
    color: #000000;
}

.qr-code{
    margin-top:25px;
}

/* Right: Form */
.form-section{
    width:420px;
    background:rgba(255,255,255,0.75);
    backdrop-filter:blur(10px);
    padding:35px;
    border-radius:20px;
    box-shadow:0 15px 40px rgba(0,0,0,0.08);
}

h2{
    text-align:center;
    margin-bottom:20px;
    font-weight:600;
    color: #223351;
}

input, select{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:10px;
    border:1px solid #ddd;
    transition:0.3s;
    font-family: 'Poppins', sans-serif;
}

input:focus, select:focus{
    border-color:#223351;
    outline:none;
}

button{
    width:100%;
    padding:12px;
    margin-top:10px;
    border:none;
    border-radius:30px;
    background:#223351;
    color:white;
    cursor:pointer;
    transition:0.3s;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

button:hover{
    transform:scale(1.04);
    background: #2c405c;
}

/* Disabled Buttons */
button:disabled{
    background:gray;
    cursor:not-allowed;
}

/* Message */
.message{
    margin-top:15px;
    font-weight:600;
    color:green;
    text-align: center;
}

/* Count box */
.count-box{
    font-weight:600;
    margin-bottom:15px;
    color: #223351;
}

/* Preview Wrapper */
.preview-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
}

/* Checkbox */
.checkbox{
    display:flex;
    align-items:center;
    gap:8px;
    margin:10px 0;
    font-size:14px;
    color: #495057;
}

.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #223351;
}

/* Cards Preview Page */
.cards-wrapper{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
    justify-content:center;
}

button.print-btn{
    padding:10px 20px;
    background:#223351;
    color:white;
    border:none;
    border-radius:5px;
    cursor:pointer;
    margin:20px auto;
    display:block;
}

button.print-btn:hover{
    background:#2c405c;
}

/* Admin Modal */
#adminModal{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#adminModalContent{
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

#adminModalContent h2{
    color: #223351;
    margin-bottom: 25px;
    text-align: center;
}

#adminPassword{
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

#adminPassword:focus{
    border-color: #223351;
    outline: none;
}

.modal-buttons{
    display: flex;
    gap: 10px;
}

.modal-buttons button{
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 0;
}

.modal-buttons button:first-child{
    background: #223351;
    color: white;
}

.modal-buttons button:first-child:hover{
    background: #2c405c;
}

.modal-buttons .cancel-btn{
    background: #f0f0f0;
    color: #333;
}

.modal-buttons .cancel-btn:hover{
    background: #e0e0e0;
}

/* Action Buttons */
.action-buttons{
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* PRINT CSS - FIXED FOR BOTH PAPER TYPES */
@media print {
    /* Base print styles */
    @page {
        size: 400px 560px;
        margin: 0;
    }
    
    /* For A4 paper - card will be centered */
    @page {
        size: A4 portrait;
        margin: 0;
    }
    
    body {
        margin: 0;
        padding: 0;
        background: white;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }
    
    /* Hide all other elements */
    .nav-buttons, .header, .right-column, .message, 
    button, .button-group, h2, .count-box-header, 
    .event-selector, form, .container > *:not(.two-column) {
        display: none !important;
    }
    
    .container {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100%;
        height: 100%;
    }
    
    .two-column {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
        height: 100%;
    }
    
    .left-column {
        display: block !important;
        width: 400px;
        height: 560px;
        margin: 0 auto !important;
        padding: 0 !important;
        box-shadow: none;
    }
    
    .card-preview {
        width: 400px !important;
        height: 560px !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background-size: cover !important;
        background-position: center !important;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        border-radius: 0 !important;
    }
    
    .card-text {
        margin-top: 120px !important;
        color: #000000 !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        text-align: center;
        width: 100%;
        padding: 0 15px;
        font-size: 22px;
    }
    
    .qr-code {
        margin-top: 25px !important;
        background: white !important;
        padding: 8px !important;
        border-radius: 12px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        display: inline-block !important;
    }
    
    .qr-code img {
        width: 80px !important;
        height: auto !important;
        display: block !important;
    }
    
    .right-column {
        display: none !important;
    }
}

/* For custom card size paper */
@media print and (width: 400px) and (height: 560px) {
    body {
        display: block;
    }
    
    .left-column {
        box-shadow: none;
    }
}
/* Responsive */
@media(max-width:900px){
    .main-wrapper, .wrapper{
        flex-direction:column;
        align-items:center;
    }

    .card-preview, .form-section, .container{
        width:90%;
        max-width: 400px;
    }
    
    .panel{
        width: 100%;
        max-width: 320px;
    }
    
    .nav-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav-btn {
        width: 250px;
        text-align: center;
        justify-content: center;
    }
}

@media(max-width:768px){
    header h1{
        font-size: 24px;
    }
    
    .container{
        gap: 20px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 280px;
    }
}