/* Asset Manager Public Styles - Dark Mode Optimized */

/* Gallery Container - Dark Mode Theme */
.asset-manager-gallery {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background: transparent !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Layout Types */
.asset-manager-gallery.layout-full-width {
    max-width: none;
    width: 100%;
}

.asset-manager-gallery.layout-boxed {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.asset-manager-gallery.layout-boxed .asset-search-wrapper {
    max-width: 350px;
}

/* Comprehensive white-line elimination */
.asset-manager-gallery,
.asset-manager-gallery * {
    border-image: none !important;
    background-image: none !important;
}

.asset-manager-gallery *:not(.doclink):not(img) {
    border-color: #444 !important;
}

/* Remove any theme interference */
.asset-manager-gallery *,
.asset-manager-gallery *::before,
.asset-manager-gallery *::after {
    box-sizing: border-box;
}

/* Override any theme table styles */
.asset-manager-gallery table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

.asset-manager-gallery table,
.asset-manager-gallery table * {
    border-color: #444 !important;
}

/* Nuclear option - remove all white/light borders */
.asset-manager-gallery *[style*="border"],
.asset-manager-gallery *[style*="white"],
.asset-manager-gallery *[style*="#fff"],
.asset-manager-gallery *[style*="#f"] {
    border-color: #444 !important;
}

/* Force dark borders on any remaining elements */
.asset-manager-gallery .wp-block-table,
.asset-manager-gallery .wp-block-table *,
.asset-manager-gallery table,
.asset-manager-gallery tbody,
.asset-manager-gallery thead,
.asset-manager-gallery tr,
.asset-manager-gallery td,
.asset-manager-gallery th {
    border-color: #444 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Search Functionality */

.asset-search {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #555;
    border-radius: 8px;
    background: #2a2a2a;
    color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.asset-search:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
    background: #333;
}

.asset-search::placeholder {
    color: #aaa;
}

/* Search Wrapper - Clean and Simple */
.asset-search-wrapper {
    max-width: 400px;
    margin: 0 auto 20px auto;
    text-align: center;
    display: block;
    width: 100%;
}

/* Force dark mode for search - override light mode */
.asset-search {
    background: #2a2a2a !important;
    color: #fff !important;
    border-color: #555 !important;
}

.asset-search:focus {
    background: #333 !important;
    border-color: #4a9eff !important;
}

.asset-search::placeholder {
    color: #aaa !important;
}

/* Table Wrapper */
.product-table-wrapper {
    overflow-x: auto;
    margin: 0 auto;
    max-width: 100%;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Main Table Styles - Force Dark Mode */
.asset-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a !important;
    color: #fff !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    margin: 0 auto;
    border: 2px solid #444 !important;
    table-layout: fixed;
}

/* Remove any potential white lines/borders */
.asset-table,
.asset-table *,
.asset-table::before,
.asset-table::after {
    border-color: #444 !important;
    outline: none !important;
}

/* Force all table elements to dark theme */
.asset-table tr,
.asset-table td,
.asset-table th {
    border-color: #444 !important;
    background-color: transparent !important;
}

/* Table Header - Force Dark Mode */
.asset-table thead {
    background: #2a2a2a !important;
}

.asset-table th {
    padding: 16px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #666 !important;
    color: #fff !important;
    border-left: 1px solid #555 !important;
}

.asset-table th:first-child {
    border-left: none !important;
}

/* Table Body - Force Dark Mode */
.asset-table tbody tr {
    border-bottom: 1px solid #555 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    transition: background-color 0.3s ease;
}

.asset-table tbody tr:hover {
    background: #222 !important;
}

/* Ensure no white horizontal lines between rows */
.asset-table tbody tr:first-child {
    border-top: none !important;
}

.asset-table tbody tr:last-child {
    border-bottom: none !important;
}

/* Add vertical borders between table cells */
.asset-table td {
    border-left: 1px solid #444 !important;
}

.asset-table td:first-child {
    border-left: none !important;
}

/* Table Cells */
.asset-table td {
    padding: 20px;
    vertical-align: top;
    text-align: center;
}

/* Image Cell */
.product-image-cell {
    width: 180px;
    position: relative;
    vertical-align: middle;
    text-align: center;
    height: 200px;
    padding: 20px 10px;
}

.image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.product-image-cell img {
    max-width: 160px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image-cell img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Force dark shadow for images in all modes */
.product-image-cell img {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.product-image-cell img:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Ensure GIF animations are preserved and properly styled */
.product-image-cell img[src$=".gif"],
.product-image-cell img[src*=".gif?"] {
    image-rendering: auto !important;
    image-rendering: -webkit-optimize-contrast !important;
    -ms-interpolation-mode: auto !important;
}

.no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 120px;
    background: #333 !important;
    color: #888 !important;
    border-radius: 8px;
    font-size: 14px;
    margin: 40px auto;
    border: 1px solid #555 !important;
}

/* Info Cells - Equal width for all 3 download columns */
.product-info-cell {
    text-align: left;
    width: calc((100% - 180px) / 3); /* Divide remaining space equally among 3 columns */
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

/* Boxed Layout Responsive Adjustments */
.asset-manager-gallery.layout-boxed .product-info-cell {
    width: calc((100% - 160px) / 3); /* Slightly smaller for boxed layout */
}

.asset-manager-gallery.layout-boxed .product-image-cell {
    width: 160px; /* Slightly smaller images in boxed layout */
}

.asset-manager-gallery.layout-boxed .product-image-cell img {
    max-width: 140px;
    max-height: 140px;
}

.asset-manager-gallery.layout-boxed .no-thumbnail {
    width: 140px;
    height: 100px;
}

/* Text wrapping improvements for boxed layout */
.asset-manager-gallery.layout-boxed .product-detail-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
}

.asset-manager-gallery.layout-boxed .product-details-card {
    min-height: auto;
    height: auto;
    max-width: 100%;
    overflow: hidden;
}

.asset-manager-gallery.layout-boxed .asset-table {
    table-layout: fixed;
    width: 100%;
}

.asset-manager-gallery.layout-boxed .product-info-cell {
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    max-width: 0; /* Forces table-layout: fixed to work properly */
    overflow: hidden;
}

/* Product Details Card - Force Dark Mode */
.product-details-card {
    background: #2a2a2a !important;
    border: 1px solid #555 !important;
    border-radius: 8px;
    padding: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.product-details-card:hover {
    background: #333 !important;
    border-color: #666 !important;
}

.product-detail-item {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    white-space: normal;
}

.product-detail-item:last-child {
    margin-bottom: 0;
}

.product-detail-item strong {
    color: #fff !important;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: block;
}

/* Download Links - Enhanced for Dark Mode */
.doclink {
    color: #66BB6A !important;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid #66BB6A !important;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
    background: transparent !important;
    font-size: 13px;
}

.doclink:hover {
    background: #66BB6A !important;
    color: #1a1a1a !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.4) !important;
    border-color: #66BB6A !important;
}

/* No Results Message */
.no-results td {
    text-align: center;
    padding: 40px 20px;
    color: #aaa !important;
    font-style: italic;
    background: #1a1a1a !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-image-cell {
        width: 140px;
        min-height: 150px;
    }
    
    .product-image-cell img {
        max-width: 130px;
        max-height: 130px;
    }
    
    .no-thumbnail {
        width: 130px;
        height: 90px;
    }
    
    /* Boxed layout adjustments for tablets */
    .asset-manager-gallery.layout-boxed {
        max-width: 800px;
        padding: 0 15px;
    }
    
    .asset-manager-gallery.layout-boxed .product-info-cell {
        width: calc((100% - 140px) / 3);
    }
    
    .asset-manager-gallery.layout-boxed .product-image-cell {
        width: 140px;
    }
    
    .asset-manager-gallery.layout-boxed .product-image-cell img {
        max-width: 120px;
        max-height: 120px;
    }
}

@media (max-width: 768px) {
    /* Force mobile-first approach - completely override table styles */
    .asset-manager-gallery {
        margin: 10px 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .product-table-wrapper {
        overflow-x: visible !important;
        overflow-y: visible !important;
        margin: 0 !important;
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Completely hide table structure and create mobile cards */
    .asset-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        table-layout: auto !important;
    }
    
    .asset-table thead {
        display: none !important;
    }
    
    .asset-table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .asset-table tr {
        display: block !important;
        width: 100% !important;
        margin: 0 0 30px 0 !important;
        padding: 0 !important;
        border: 3px solid #666 !important;
        border-radius: 15px !important;
        background: #1a1a1a !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }
    
    .asset-table td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
        vertical-align: top !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile image section */
    .product-image-cell {
        display: block !important;
        width: 100% !important;
        padding: 30px 20px !important;
        text-align: center !important;
        background: #2a2a2a !important;
        border-bottom: 2px solid #666 !important;
        border-radius: 12px 12px 0 0 !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }
    
    .image-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
    }
    
    .product-image-cell img {
        max-width: 250px !important;
        max-height: 250px !important;
        width: auto !important;
        height: auto !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    }
    
    .no-thumbnail {
        width: 200px !important;
        height: 150px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #333 !important;
        color: #888 !important;
        border-radius: 10px !important;
        font-size: 16px !important;
        margin: 0 auto !important;
        border: 2px solid #555 !important;
    }
    
    /* Mobile download sections */
    .product-info-cell {
        display: block !important;
        width: 100% !important;
        padding: 25px !important;
        border-bottom: 2px solid #444 !important;
        box-sizing: border-box !important;
        background: #1a1a1a !important;
    }
    
    .product-info-cell:last-child {
        border-bottom: none !important;
        border-radius: 0 0 12px 12px !important;
    }
    
    /* Mobile section headers */
    .product-info-cell::before {
        content: attr(data-label) !important;
        display: block !important;
        font-weight: 800 !important;
        color: #4a9eff !important;
        font-size: 20px !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        border-bottom: 3px solid #4a9eff !important;
        text-align: center !important;
    }
    
    /* Enhanced mobile cards */
    .product-details-card {
        display: block !important;
        width: 100% !important;
        background: #2a2a2a !important;
        border: 2px solid #555 !important;
        border-radius: 12px !important;
        padding: 25px !important;
        margin: 0 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        box-sizing: border-box !important;
    }
    
    .product-detail-item {
        display: block !important;
        width: 100% !important;
        margin: 0 0 18px 0 !important;
        font-size: 16px !important;
        line-height: 1.6 !important;
        color: #e0e0e0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    .product-detail-item:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Mobile download buttons */
    .doclink {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 18px 25px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        text-align: center !important;
        margin: 20px 0 !important;
        border: 3px solid #66BB6A !important;
        border-radius: 12px !important;
        background: transparent !important;
        color: #66BB6A !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        transition: all 0.3s ease !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .doclink:hover,
    .doclink:active,
    .doclink:focus {
        background: #66BB6A !important;
        color: #1a1a1a !important;
        transform: none !important;
        text-decoration: none !important;
    }
    
    /* Hide empty cells completely */
    .product-info-cell:empty,
    .product-info-cell:has(.product-details-card:empty) {
        display: none !important;
    }
    
    /* Mobile search */
    .asset-search {
        width: 100% !important;
        max-width: none !important;
        font-size: 18px !important;
        padding: 18px 20px !important;
        border: 3px solid #555 !important;
        border-radius: 12px !important;
        background: #2a2a2a !important;
        color: #fff !important;
        box-sizing: border-box !important;
    }
    
    .asset-search-wrapper {
        width: 100% !important;
        margin: 0 0 30px 0 !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
    }
    
    /* Boxed layout mobile overrides */
    .asset-manager-gallery.layout-boxed {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 10px !important;
        margin: 10px auto !important;
        box-sizing: border-box !important;
    }
    
    .asset-manager-gallery.layout-boxed .product-details-card {
        padding: 20px !important;
    }
    
    .asset-manager-gallery.layout-boxed .product-detail-item {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
    
    .asset-manager-gallery.layout-boxed .doclink {
        font-size: 16px !important;
        padding: 16px 20px !important;
    }
}

/* Medium tablet breakpoint for boxed layout */
@media (max-width: 650px) and (min-width: 481px) {
    .asset-manager-gallery.layout-boxed {
        max-width: 600px;
        padding: 0 15px;
    }
    
    .asset-manager-gallery.layout-boxed .product-info-cell {
        width: calc((100% - 120px) / 3);
    }
    
    .asset-manager-gallery.layout-boxed .product-image-cell {
        width: 120px;
    }
    
    .asset-manager-gallery.layout-boxed .product-image-cell img {
        max-width: 100px;
        max-height: 100px;
    }
    
    .asset-manager-gallery.layout-boxed .product-details-card {
        padding: 16px;
    }
    
    .asset-manager-gallery.layout-boxed .product-detail-item {
        font-size: 13px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile devices - refine the mobile layout further */
    .asset-manager-gallery {
        margin: 5px 0 !important;
        padding: 0 !important;
    }
    
    .product-table-wrapper {
        padding: 5px !important;
    }
    
    .asset-table tr {
        margin: 0 0 25px 0 !important;
        border: 2px solid #666 !important;
    }
    
    .product-image-cell {
        padding: 25px 15px !important;
    }
    
    .product-image-cell img {
        max-width: 200px !important;
        max-height: 200px !important;
    }
    
    .no-thumbnail {
        width: 160px !important;
        height: 120px !important;
        font-size: 14px !important;
    }
    
    .product-info-cell {
        padding: 20px !important;
    }
    
    .product-info-cell::before {
        font-size: 18px !important;
        margin-bottom: 18px !important;
    }
    
    .product-details-card {
        padding: 20px !important;
    }
    
    .product-detail-item {
        font-size: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .doclink {
        padding: 16px 20px !important;
        font-size: 16px !important;
        margin: 18px 0 !important;
        border: 2px solid #66BB6A !important;
    }
    
    /* Small screen search */
    .asset-search {
        font-size: 16px !important;
        padding: 16px 18px !important;
        border: 2px solid #555 !important;
    }
    
    .asset-search-wrapper {
        padding: 0 10px !important;
        margin-bottom: 25px !important;
    }
    
    /* Small screen boxed layout */
    .asset-manager-gallery.layout-boxed {
        padding: 0 5px !important;
        margin: 5px auto !important;
    }
    
    .asset-manager-gallery.layout-boxed .product-details-card {
        padding: 18px !important;
    }
    
    .asset-manager-gallery.layout-boxed .product-detail-item {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    .asset-manager-gallery.layout-boxed .doclink {
        font-size: 15px !important;
        padding: 14px 18px !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .asset-table {
        border: 2px solid;
    }
    
    .asset-table th,
    .asset-table td {
        border: 1px solid;
    }
    
    .doclink {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .product-image-cell img,
    .product-details-card,
    .doclink,
    .asset-search {
        transition: none;
    }
    
    .product-image-cell img:hover {
        transform: none;
    }
    
    .doclink:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .asset-search-wrapper {
        display: none;
    }
    
    .asset-table {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none;
    }
    
    .product-details-card {
        background: #fff !important;
        border: 1px solid #000 !important;
    }
    
    .doclink {
        color: #000 !important;
        text-decoration: underline !important;
    }
} 