/* Theme-aware visitor card section */
.visitor-card-section {
    padding-top: 10px !important;
    margin-top: 0 !important;
    background: var(--bg-cream);
    transition: background-color 0.3s ease;
}

.visitor-card-section .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Reset any hero section interference */
.custom-css-step {
    min-height: auto !important;
    display: block !important;
    align-items: initial !important;
}

/* Force all card-related elements to be transparent in dark mode */
[data-theme="dark"] .visitor-card-section .card,
[data-theme="dark"] .visitor-card-section .card-body,
[data-theme="dark"] .visitor-card-section .container,
[data-theme="dark"] .visitor-card-section {
    background: transparent !important;
    background-color: transparent !important;
}

/* Ensure Bootstrap card defaults don't override */
[data-theme="dark"] .card {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
}

[data-theme="dark"] .visitor-card-section .card-header h4 {
    color: #000 !important;
}
/* Main card styling - Remove white background completely */
.visitor-card-section .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 20px;
    transition: all 0.3s ease;
}

/* Card header theme-aware */
.visitor-card-section .card-header {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-gold) 100%) !important;
    color: white !important;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.visitor-card-section .card-header h4 {
    color: white !important;
}

/* Card body theme-aware */
.visitor-card-section .card-body {
    background: transparent !important;
    transition: background-color 0.3s ease;
}

/* Ensure the main card background is fully theme-aware */
[data-theme="dark"] .visitor-card-section .card {
    background: transparent !important;
}

.visitor-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
}

[data-theme="dark"] .info-card {
    background: rgba(42, 42, 42, 0.9);
}

.info-card:hover {
    box-shadow: 0 8px 25px var(--shadow-medium);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.info-icon {
    color: var(--primary-gold);
    font-size: 14px;
    width: 16px;
    transition: color 0.3s ease;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.info-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    word-break: break-word;
    padding-left: 24px;
    transition: color 0.3s ease;
}

/* FIXED FOOTER SOLUTION - Theme Aware */
.card-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    box-shadow: 0 -4px 15px var(--shadow-light) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

[data-theme="dark"] .card-footer {
    background: rgba(26, 26, 26, 0.95) !important;
    box-shadow: 0 -4px 15px rgba(244, 208, 63, 0.1) !important;
}

/* Add bottom padding to card body to prevent content being hidden */
.card-body {
    padding-bottom: 100px !important; /* Extra space for fixed footer */
}

/* Remove float-right since we're using flexbox */
.card-footer .float-right {
    float: none !important;
}

/* Mobile Optimization - Table-like compact layout */
@media (max-width: 768px) {
    /* Force the section to top on mobile */
    .visitor-card-section {
        padding-top: 5px !important;
        margin-top: 0 !important;
    }
    
    .visitor-card-section .container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    .visitor-card-section .card.my-2 {
        margin: 5px 0 !important;
    }
    
    .visitor-info-grid {
        display: block; /* Switch to table-like layout */
        margin-bottom: 10px;
    }
   
    .info-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        margin-bottom: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-cream);
        box-shadow: none;
    }

    [data-theme="dark"] .info-card {
        background: rgba(42, 42, 42, 0.9);
    }

    .info-card:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

    .info-card:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        border-bottom: 1px solid var(--border-light);
    }

    .info-card:hover {
        background: var(--shadow-light);
        transform: none;
        box-shadow: none;
    }

    [data-theme="dark"] .info-card:hover {
        background: rgba(244, 208, 63, 0.1);
    }

    .info-header {
        margin-bottom: 0;
        gap: 6px;
    }

    .info-icon {
        font-size: 12px;
        width: 14px;
    }

    .info-label {
        font-size: 11px;
        margin-bottom: 0;
    }

    .info-value {
        padding-left: 0;
        font-size: 14px;
        font-weight: 500;
        text-align: right;
        flex: 1;
        margin-left: 10px;
        color: var(--text-dark);
    }

    .card-body {
        padding: 15px 15px 100px 15px !important; /* Adjusted for mobile */
    }

    .card-footer {
        padding: 15px !important;
        gap: 10px;
    }

    .card-footer .btn {
        font-size: 14px;
        padding: 8px 16px;
        flex: 1; /* Make buttons equal width on mobile */
        margin: 0 5px;
    }
}


/* visitor ID styles */
/* Compact ID Card Page */
.id-card-page {
    padding-top: 0.5rem !important;
    margin-top: 0 !important;
    min-height: calc(100vh - 100px);
    background: var(--bg-cream);
}

.id-card-page .container {
    max-width: 1200px;
    padding-top: 0;
}

/* Compact Action Panel */
.action-panel {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px var(--shadow-light);
    padding: 1.5rem;
    height: fit-content;
}

.action-panel h1 {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.action-panel .lead {
    color: var(--text-medium);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Compact Button Styling */
.id-action-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.id-action-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.btn-back {
    background: #6366f1;
    color: white !important;
}

.btn-print {
    background: #10b981;
    color: white !important;
}

.btn-home {
    background: var(--primary-gold);
    color: #1a1a1a !important;
}

/* Visitor Pass Page Styles */
.visitor-pass-page {
    background: var(--bg-cream, #faf8f5);
    min-height: 100vh;
    padding: 2rem 0;
    transition: background-color 0.3s ease;
}

.visitor-pass-page .container {
    max-width: 1400px;
}

/* Content Grid - Card on Left, Actions on Right */
.content-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Right Panel Container */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Success Header - Now in Right Panel */
.success-header {
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 30px var(--shadow-light, rgba(0, 0, 0, 0.08));
    border: 1px solid var(--border-light, rgba(212, 175, 55, 0.2));
    animation: slideInDown 0.6s ease-out;
    transition: all 0.3s ease;
}

[data-theme="dark"] .success-header {
    background: var(--card-bg, rgba(42, 42, 42, 0.95));
    border: 1px solid var(--border-light, rgba(244, 208, 63, 0.2));
}

.success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--success-color, #10b981), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.success-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.success-subtitle {
    font-size: 1.1rem;
    color: var(--text-medium, #4a5568);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.pass-id {
    display: inline-block;
    background: var(--primary-gold, #d4af37);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Actions Panel - Now in Right Panel */
.actions-panel {
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px var(--shadow-light, rgba(0, 0, 0, 0.08));
    border: 1px solid var(--border-light, rgba(212, 175, 55, 0.2));
    transition: all 0.3s ease;
    animation: slideInRight 0.6s ease-out 0.2s both;
}

[data-theme="dark"] .actions-panel {
    background: var(--card-bg, rgba(42, 42, 42, 0.95));
    border: 1px solid var(--border-light, rgba(244, 208, 63, 0.2));
}

.actions-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.actions-description {
    color: var(--text-medium, #4a5568);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-print {
    background: linear-gradient(135deg, var(--success-color, #10b981), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-medium, #4a5568);
    border: 1px solid var(--border-light, rgba(212, 175, 55, 0.2));
}

.btn-secondary:hover {
    background: white;
    color: var(--text-dark, #1a1a1a);
    border-color: var(--primary-gold, #d4af37);
    text-decoration: none;
    transform: translateY(-1px);
}

/* CHANGED: Visitor ID Card - Use specific class to avoid conflicts */
.visitor-pass-page .id-visitor-card {
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 15px 50px var(--shadow-medium, rgba(0, 0, 0, 0.12));
    border: 1px solid var(--border-light, rgba(212, 175, 55, 0.2));
    overflow: hidden;
    position: sticky;
    top: 2rem;
    animation: slideInLeft 0.6s ease-out;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

[data-theme="dark"] .visitor-pass-page .id-visitor-card {
    background: var(--card-bg, rgba(42, 42, 42, 0.95));
    border: 1px solid var(--border-light, rgba(244, 208, 63, 0.2));
}

/* CHANGED: ID Card Header - Use specific class */
.visitor-pass-page .id-card-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    padding: 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

[data-theme="dark"] .visitor-pass-page .id-card-header {
    background: linear-gradient(135deg, #6B4423 0%, #8B5A3C 100%);
}

.visitor-pass-page .id-card-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    rotate: 45deg;
}

[data-theme="dark"] .visitor-pass-page .id-card-header::after {
    background: linear-gradient(135deg, #6B4423 0%, #8B5A3C 100%);
}

.visitor-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    display: block;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.visitor-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.visitor-title {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1rem;
}

/* CHANGED: ID Card Body - Use specific class */
.visitor-pass-page .id-card-body {
    padding: 1.5rem;
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .visitor-pass-page .id-card-body {
    background: var(--card-bg, rgba(42, 42, 42, 0.95));
}

.info-section {
    margin-bottom: 1rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-gold, #d4af37);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

[data-theme="dark"] .section-title {
    color: var(--primary-gold, #f4d03f);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
    color: var(--text-medium, #4a5568);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

[data-theme="dark"] .info-item {
    color: var(--text-medium, #e5e5e5);
}

.info-icon {
    width: 16px;
    color: var(--primary-gold, #d4af37);
    transition: color 0.3s ease;
}

[data-theme="dark"] .info-icon {
    color: var(--primary-gold, #f4d03f);
}

.host-section {
    background: var(--shadow-light, rgba(212, 175, 55, 0.1));
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light, rgba(212, 175, 55, 0.2));
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .host-section {
    background: rgba(244, 208, 63, 0.1);
    border-color: rgba(244, 208, 63, 0.2);
}

/* CHANGED: ID Company Footer - Use specific class */
.visitor-pass-page .id-company-footer {
    background: var(--text-dark, #1a1a1a);
    color: white;
    padding: 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .visitor-pass-page .id-company-footer {
    background: var(--text-dark, #f8f9fa);
    color: #1a1a1a;
}

.company-logo {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.company-name {
    font-weight: 700;
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.company-contact {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.1rem;
}

.pass-badge {
    background: var(--primary-gold, #d4af37);
    color: var(--text-dark, #1a1a1a);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
    transition: all 0.3s ease;
}

[data-theme="dark"] .pass-badge {
    background: var(--primary-gold, #f4d03f);
    color: #1a1a1a;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 3rem;
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-light, rgba(0, 0, 0, 0.08));
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--warning-color, #f59e0b), #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.error-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 0.5rem;
}

.error-subtitle {
    color: var(--text-medium, #4a5568);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 380px 1fr;
        gap: 2rem;
    }

    .visitor-pass-page .container {
        max-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .visitor-pass-page .id-visitor-card {
        position: static;
        max-width: none;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .visitor-pass-page {
        padding: 1.5rem 0;
    }
}

@media (max-width: 768px) {
    .visitor-pass-page {
        padding: 1rem 0;
    }

    .success-title {
        font-size: 1.75rem;
    }

    .success-header {
        padding: 1.5rem;
    }

    .actions-panel {
        padding: 1.5rem;
    }

    .visitor-pass-page .id-card-header {
        padding: 1.5rem 1rem;
    }

    .visitor-pass-page .id-card-body {
        padding: 1.25rem;
    }

    .visitor-pass-page .id-company-footer {
        padding: 1.25rem;
    }

    .content-grid {
        gap: 1.5rem;
    }

    .actions-title {
        font-size: 1.25rem;
    }

    .actions-description {
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .action-buttons {
        gap: 0.75rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .error-actions .action-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .success-title {
        font-size: 1.5rem;
    }

    .success-subtitle {
        font-size: 0.95rem;
    }

    .visitor-photo {
        width: 80px;
        height: 80px;
    }

    .visitor-name {
        font-size: 1.25rem;
    }

    .visitor-pass-page .id-card-header {
        padding: 1rem;
    }

    .visitor-pass-page .id-card-body {
        padding: 1rem;
    }

    .visitor-pass-page .id-company-footer {
        padding: 0.75rem;
    }

    .content-grid {
        gap: 1.5rem;
    }

    .success-header {
        padding: 1.25rem;
    }

    .actions-panel {
        padding: 1.25rem;
    }

    .actions-title {
        font-size: 1.25rem;
    }

    .actions-description {
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Print Styles */
@media print {
    .right-panel,
    .success-header,
    .actions-panel {
        display: none !important;
    }

    .visitor-pass-page .id-visitor-card {
        box-shadow: none;
        border: 2px solid var(--text-dark, #1a1a1a);
        page-break-inside: avoid;
        position: static;
        margin: 0;
        max-width: none;
        width: 100%;
    }

    .visitor-pass-page {
        padding: 0;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 400px;
        margin: 0 auto;
    }

    .container {
        max-width: none;
    }
}

/* Enhanced Hover Effects */
.visitor-pass-page .id-visitor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px var(--shadow-medium, rgba(0, 0, 0, 0.15));
}

.success-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px var(--shadow-light, rgba(0, 0, 0, 0.1));
}

.actions-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px var(--shadow-light, rgba(0, 0, 0, 0.1));
}

/* Additional Theme Support */
[data-theme="dark"] .success-title {
    color: var(--text-dark, #f8f9fa);
}

[data-theme="dark"] .success-subtitle {
    color: var(--text-medium, #b3b3b3);
}

[data-theme="dark"] .actions-title {
    color: var(--text-dark, #f8f9fa);
}

[data-theme="dark"] .actions-description {
    color: var(--text-medium, #b3b3b3);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(66, 66, 66, 0.8);
    color: var(--text-medium, #e5e5e5);
    border: 1px solid var(--border-light, rgba(244, 208, 63, 0.2));
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(66, 66, 66, 1);
    color: var(--text-dark, #f8f9fa);
    border-color: var(--primary-gold, #f4d03f);
}