@page { 
    size: A3 landscape;
    scale: 0.7;
    margin: minimal;
}
@media print {
    .pagebreak { page-break-before: always !important; } /* page-break-after works, as well */
}
html {
    scroll-behavior: smooth !important;
    /* Considering space in scroll behavior*/
    scroll-padding-top: 100px !important;
}
body {
    background-color: #f8f9fa !important;
    color: #333333 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    padding-top: 90px !important; /* Increased space for header with user button */
}
h1 {
    color: #2D1B1B !important;
    font-weight: 600 !important;
}
h2 {
    color: #2D1B1B !important;
    font-weight: 600 !important;
    margin-bottom: 20px !important;
}
input{
    height: 40px !important;
    font-size: 14px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-family: inherit !important;
}
input:focus {
    outline: none !important;
    border-color: #007BFF !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}
.section {
    border: 1px solid #e0e0e0 !important;
    margin: 20px 8px !important; /* Increased margin for better separation */
    padding: 24px !important; /* Increased padding for better content spacing */
    border-top: 4px solid #2D1B1B !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.iframe-container {
    position: relative !important;
    overflow: hidden !important;
    padding-top: 56.25% !important; /* 16:9 aspect ratio (change to 4:3 for 4:3 videos) */
}
.iframe-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.button-go{
    background-color: #FFD700 !important;
    border: none !important;
    color: #2D1B1B !important;
    padding: 8px 16px !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.button-go:hover {
    background-color: #F4C430 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}
.button-area{
    border: 1px solid #e0e0e0 !important;
    color: #2D1B1B !important;
    padding: 8px 16px !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    background-color: white !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.button-area:hover {
    background-color: #f8f9fa !important;
    border-color: #007BFF !important;
    color: #007BFF !important;
}
.button-area-selected{
    border: 1px solid #007BFF !important;
    color: white !important;
    padding: 8px 16px !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    background-color: #007BFF !important;
    height: 40px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3) !important;
}
.button-gray-go{
    background-color: white !important;
    border: 1px solid #e0e0e0 !important;
    color: #2D1B1B !important;
    padding: 8px 16px !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.button-gray-go:hover {
    background-color: #f8f9fa !important;
    border-color: #007BFF !important;
    color: #007BFF !important;
}
.fixedElement {
    background-color: #2D1B1B !important;
    position: fixed !important;
    top: 0 !important; /* Changed from -1px to 0 */
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
textarea{
    font-size: 14px !important;
    height: 120px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-family: inherit !important;
    resize: vertical !important;
}
textarea:focus {
    outline: none !important;
    border-color: #007BFF !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

/* Main content spacing */
#report-content {
    margin-top: 20px !important;
}

/* Report description specific spacing */
#report-description {
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    margin: 20px 8px !important;
    padding: 24px !important; /* Added padding for better content spacing */
}

/* Section spacing adjustments */
.section {
    border: 1px solid #e0e0e0 !important;
    margin: 20px 8px !important; /* Increased margin for better separation */
    padding: 24px !important; /* Increased padding for better content spacing */
    border-top: 4px solid #2D1B1B !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Override for fixed element to ensure it doesn't interfere */
.fixedElement {
    background-color: #2D1B1B !important;
    position: fixed !important;
    top: 0 !important; /* Changed from -1px to 0 */
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Additional modern styling based on design reference */
table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 16px 0 !important;
}

td {
    padding: 16px !important;
    border: 1px solid #e0e0e0 !important;
    background-color: white !important;
}

/* Table headers styling */
.td-area-all, .td-area-tk, .td-area-opt, .td-area-infrasec, .td-area-uid {
    font-weight: 600 !important;
    background-color: #f8f9fa !important;
    color: #2D1B1B !important;
    border-bottom: 2px solid #e0e0e0 !important;
}

/* Modal styling */
.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
    background-color: #2D1B1B !important;
    color: white !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0 !important;
}

.modal-header .close {
    color: white !important;
    opacity: 0.8 !important;
}

.modal-title {
    font-weight: 600 !important;
}

.modal-footer {
    border-top: 1px solid #e0e0e0 !important;
    background-color: #f8f9fa !important;
    border-radius: 0 0 12px 12px !important;
}

/* Button enhancements */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-primary {
    background-color: #007BFF !important;
    border-color: #007BFF !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Title styling in header */
#title {
    font-weight: 600 !important;
    font-size: 20px !important;
    color: white !important;
}

/* Iframe container enhancements */
.iframe-container {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Report description styling */
#report-description {
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    margin: 20px 8px !important;
    padding: 24px !important; /* Added padding for better content spacing */
}

/* Header/Navbar specific styling */
#header-report {
    padding: 12px 20px !important;
    width: 99% !important;
    min-height: 70px !important; /* Changed to min-height to allow expansion */
    height: auto !important; /* Allow dynamic height adjustment */
    display: flex !important;
    align-items: center !important;
    overflow: visible !important; /* Ensure dropdown menus are visible */
}

/* Ensure all header content is vertically centered */
#header-report .row {
    display: flex !important;
    align-items: center !important;
}

#header-report .col-md-3,
#header-report .col-md-9 {
    display: flex !important;
    align-items: center !important;
}

#header-report .col-md-9 {
    justify-content: flex-end !important;
}

#header-report .btn-group {
    margin-right: 8px !important;
    display: flex !important;
    align-items: center !important;
}

/* Bootstrap dropdown buttons in header */
#header-report .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    height: 40px !important; /* Fixed height for consistency */
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

#header-report .btn-secondary:hover,
#header-report .btn-secondary:focus,
#header-report .btn-secondary:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    box-shadow: none !important;
}

#header-report .btn-secondary.dropdown-toggle::after {
    margin-left: 8px !important;
}

/* Action buttons in header */
#header-report .btn-light {
    background-color: #FFD700 !important;
    border: none !important;
    color: #2D1B1B !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    height: 40px !important; /* Fixed height for consistency */
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

#header-report .btn-light:hover {
    background-color: #F4C430 !important;
    color: #2D1B1B !important;
    transform: translateY(-1px) !important;
}

/* Form inputs in header */
#header-report .form-control {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #2D1B1B !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    margin-right: 4px !important;
    height: 40px !important; /* Fixed height for consistency */
    min-width: 120px !important;
    display: flex !important;
    align-items: center !important;
}

#header-report .form-control::placeholder {
    color: #666 !important;
}

#header-report .form-control:focus {
    background-color: white !important;
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.25) !important;
    outline: none !important;
}

/* Download button specific styling */
#header-report #download_button {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

#header-report #download_button:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* Dropdown menu styling */
.dropdown-menu {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
}

/* Dropdown backdrop overlay */
.dropdown-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    z-index: 99 !important; /* Below header but above content */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.dropdown-backdrop.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure dropdowns appear above backdrop */
.dropdown-menu {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important; /* Enhanced shadow for better visibility */
    padding: 8px !important;
    z-index: 101 !important; /* Above backdrop */
}

/* Enhanced dropdown button styling when open */
.btn-group.show .btn-secondary {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important;
}

.dropdown-item {
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #007BFF !important;
}

/* User dropdown specific fixes for zoom issues */
#user-dropdown-group {
    position: relative !important;
    z-index: 102 !important; /* Higher than other dropdowns */
}

#user-dropdown-btn {
    min-width: 45px !important; /* Ensure minimum width for user initial */
    white-space: nowrap !important;
    overflow: visible !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* Fix user dropdown menu positioning and visibility */
#user-dropdown-group .dropdown-menu {
    right: 0 !important; /* Align to right edge of button */
    left: auto !important;
    min-width: 200px !important;
    margin-top: 2px !important;
    transform: none !important; /* Prevent transform issues with zoom */
    will-change: auto !important; /* Optimize for zoom changes */
}

/* Ensure dropdown content is fully visible */
#user-dropdown-group .dropdown-item-text {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 180px !important;
}

/* Override zoom effects on user dropdown */
@media screen {
    #user-dropdown-group {
        transform: scale(1.111) !important; /* Compensate for 90% body zoom (1/0.9 ≈ 1.111) */
        transform-origin: top right !important;
        margin-right: -8px !important; /* Adjust positioning after scale */
    }
}

/* Ensure user button is always visible in header */
#header-report .col-md-9 {
    overflow: visible !important;
}

/* Mobile specific fixes for user dropdown */
@media (max-width: 768px) {
    #user-dropdown-group {
        transform: scale(1.111) !important; /* Maintain compensation on mobile */
        margin-right: -4px !important;
        margin-top: 4px !important;
    }
    
    #user-dropdown-group .dropdown-menu {
        min-width: 180px !important;
        right: -10px !important; /* Better positioning on mobile */
    }
}

/* Responsive improvements for mobile devices */
@media (max-width: 768px) {
    body {
        padding-top: 130px !important; /* More space for mobile due to header wrapping and user button */
    }
    
    #header-report {
        height: auto !important; /* Auto height for mobile */
        min-height: 110px !important; /* Increased for user button */
    }
    
    .button-area, .button-area-selected, .button-go, .button-gray-go {
        font-size: 12px !important;
        padding: 6px 12px !important;
        margin: 2px !important;
    }
    
    .section {
        margin: 8px 4px !important; /* Reduced margin for mobile */
        padding: 16px !important; /* Reduced padding for mobile */
    }
    
    #title {
        font-size: 18px !important;
    }
    
    #header-report .btn-group {
        margin-right: 4px !important;
        margin-bottom: 4px !important;
    }
    
    #header-report .form-control {
        min-width: 100px !important;
        font-size: 12px !important;
    }
    
    #header-report .btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    #header-report .col-md-8 {
        margin-top: 8px !important;
    }
    
    #report-description {
        margin: 10px 4px !important;
        padding: 16px !important;
    }
}

.nonPrintableArea { display: none !important;}
.isaPrintableArea { display: block !important; }
