/**
 * Substance Detail Page Styles
 * 
 * @package Gasprobenentnahme
 * @since 1.0.2
 */

/* Fix Elementor table borders */
table, th, td, .wp-block-calendar tbody td, .wp-block-calendar th { 
    border: none !important; 
}

/* Reduce top spacing for Elementor/Theme conflicts */
body .fiu-substance-detail {
    margin-top: 0 !important;
    padding-top: 5px !important;
}

.elementor-page .fiu-substance-detail {
    margin-top: 0 !important;
    padding-top: 5px !important;
}

/* Fix WordPress Block Group padding */
.wp-block-group.has-global-padding,
.wp-block-group.alignfull.has-global-padding,
.wp-block-group.is-layout-constrained.has-global-padding {
    padding-top: 10px !important;
    margin-top: 0 !important;
}

/* Fix main content area spacing */
main#wp--skip-link--target,
.wp-block-group.is-layout-constrained {
    padding-top: 10px !important;
    margin-top: 0 !important;
}

/* Fix Elementor header spacing */
header[data-elementor-type="header"] {
    margin-bottom: 0 !important;
}

/* Fix Elementor main content spacing */
.site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix Elementor page wrapper */
.elementor-page {
    margin-top: 0 !important;
}

/* Fix Elementor content area */
.elementor-section {
    margin-top: 0 !important;
}

.fiu-substance-detail {
    max-width: 1200px;
    margin: 0 auto !important;
    padding: 10px 20px 20px 20px !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fiu-breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.fiu-breadcrumbs a {
    color: #0073aa;
    text-decoration: none;
}

.fiu-breadcrumbs a:hover {
    text-decoration: underline;
}

.fiu-breadcrumbs .separator {
    margin: 0 8px;
    color: #999;
}

/* Title Section */
.fiu-title-section {
    margin-bottom: 10px;
}

.fiu-h1 {
    font-size: 2rem; /* larger title */
    font-weight: 600;
    color: #203556;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Intro Section Container */
.fiu-intro-section {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    justify-content: space-between;
}

.fiu-intro {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    flex: 1;
    max-width: 65%;
}

.chemical-structure {
    flex-shrink: 0;
    width: 200px;
    height: 160px;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    background: #ffffff;
    padding: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chemical-structure::before {
    content: "CHEMICAL STRUCTURE";
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 2px;
    font-family: 'Arial', sans-serif;
    z-index: 10;
    white-space: nowrap;
}

.chemical-structure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 2px;
    overflow: hidden;
}

/* Comprehensive Information Text */
.fiu-comprehensive-info {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 5px;
}

.fiu-measurement-ranges {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    clear: both;
    overflow-x: auto;
}

.fiu-measurement-ranges h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 15px;
}

/* Use the plugin's table design for consistency */
.substances-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    table-layout: fixed;
}
.substances-table th {
    text-align: left;
}
.substances-table th,
.substances-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

/* mimic header banding from overview table */
.substances-table thead {
    background: #f9fafb;
}

.substances-table thead th {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #6B7280;
}

.substances-table tbody tr {
    background: #ffffff;
}

.substances-table tbody tr:nth-child(even) {
    background: #FAFAFA;
}

.fiu-sensor-technology {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.fiu-sensor-technology h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

.fiu-sensor-technology p {
    color: #374151;
    font-size: 1rem;
    margin: 0;
}

.fiu-intent-content {
    margin-bottom: 30px;
}

.fiu-intent-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 15px;
}

.fiu-intent-content p {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 15px;
}

.fiu-cta {
    /* match overview header gradient */
    background: linear-gradient(to right, #07777F, #00B9BC);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.fiu-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.fiu-cta p {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.fiu-cta-button {
    display: inline-block;
    background: white;
    color: #07777F;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.fiu-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: #00B9BC;
}

.fiu-related-substances {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.fiu-related-substances h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 15px;
}

.fiu-related-substances p {
    color: #374151;
    margin: 0;
    font-size: 1rem;
}

/* Related Substances List */
.related-substances-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.related-substance-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
}

.related-substance-item:hover {
    background: #e9ecef;
    border-color: #07777F;
    transform: translateY(-1px);
}

.related-substance-link {
    text-decoration: none;
    color: #374151;
    display: block;
    font-size: 1rem;
}

.related-substance-link:hover {
    color: #07777F;
}

.related-substance-link .formula {
    color: #6b7280;
    font-weight: normal;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fiu-substance-detail {
        padding: 15px;
    }
    
    .fiu-h1 {
        font-size: 2rem;
    }
    
    .fiu-ranges-table {
        font-size: 12px;
    }
    
    .fiu-ranges-table th,
    .fiu-ranges-table td {
        padding: 8px 12px;
    }
    
    .fiu-cta {
        padding: 20px;
    }
    
    .fiu-cta h2 {
        font-size: 1.5rem;
    }
    
    /* Title section responsive */
    .fiu-h1 {
        font-size: 1.5rem;
    }
    
    .fiu-intro-section {
        margin-bottom: 10px;
        flex-direction: column;
        gap: 15px;
    }
    
    .fiu-intro {
        flex: none;
        max-width: 100%;
    }
    
    .chemical-structure {
        flex-shrink: 1;
        align-self: center;
        width: 180px;
        height: 140px;
    }
    
    /* Table responsive adjustments */
    .substances-table {
        font-size: 12px;
        table-layout: auto;
        min-width: auto;
    }
    
    .substances-table th,
    .substances-table td {
        padding: 6px 8px;
        word-wrap: break-word;
    }
    
    .substances-table th:first-child,
    .substances-table td:first-child {
        width: 30%;
    }
    
    .substances-table th:nth-child(2),
    .substances-table td:nth-child(2) {
        width: 35%;
    }
    
    .substances-table th:nth-child(3),
    .substances-table td:nth-child(3) {
        width: 35%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .fiu-substance-detail {
        padding: 10px;
    }
    
    .substances-table {
        font-size: 11px;
        min-width: auto;
    }
    
    .substances-table th,
    .substances-table td {
        padding: 4px 6px;
    }
    
    .substances-table th:first-child,
    .substances-table td:first-child {
        width: 25%;
    }
    
    .substances-table th:nth-child(2),
    .substances-table td:nth-child(2) {
        width: 37.5%;
    }
    
    .substances-table th:nth-child(3),
    .substances-table td:nth-child(3) {
        width: 37.5%;
    }
}

/* Fresenius Expertise Block */
.fiu-fresenius-expertise {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    border-left: 4px solid #07777F;
}

.fiu-fresenius-expertise h2 {
    color: #07777F;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
}

.expertise-content p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #495057;
    font-size: 1rem;
}

.expertise-content p:last-child {
    margin-bottom: 0;
}

/* Array Table Styling - Copied from advanced.css */
.substances-table .embedded-min-table,
.substances-table .embedded-max-table {
    width: calc(100% + 24px) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    margin-left: -24px !important;
    padding-left: 0 !important;
    background-color: transparent !important;
}

.embedded-min-table td,
.embedded-max-table td {
    padding: 4px 0;
    padding-left: 0;
    border: none;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
    background-color: transparent;
}

.embedded-array-table {
    border-collapse: separate;
    border-spacing: 0;
}

.embedded-array-table td {
    border: none;
    padding: 4px 0;
}

.embedded-array-table,
.embedded-array-table tr,
.embedded-array-table td,
.embedded-array-table tbody,
.embedded-array-table thead {
    background-color: transparent !important;
}

/* Make embedded tables completely transparent */
.substances-table .embedded-min-table,
.substances-table .embedded-max-table,
.substances-table .embedded-min-table tr,
.substances-table .embedded-max-table tr,
.substances-table .embedded-min-table td,
.substances-table .embedded-max-table td,
.substances-table .embedded-min-table tbody,
.substances-table .embedded-max-table tbody,
.substances-table .embedded-min-table thead,
.substances-table .embedded-max-table thead {
    background-color: transparent !important;
    border: none !important;
}

