/**
 * Chemical Structure Styles
 * 
 * @package Gasprobenentnahme
 * @since 1.0.2
 */

/* Chemical Structure Container */
.chemical-structure {
    display: inline-block;
    vertical-align: top;
    margin-right: 20px;
    margin-bottom: 20px;
    text-align: center;
    background: #ffffff;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    padding: 8px;
    width: 200px;
    height: 160px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Scientific label */
.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;
}

/* Structure Title */
.structure-title {
    font-size: 0.85rem;
    color: #34495e;
    margin-top: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Arial', sans-serif;
}

/* Fallback Display */
.structure-fallback {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.formula-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Times New Roman', serif;
    margin-bottom: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.structure-note {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    font-family: 'Arial', sans-serif;
}

/* Image Styling */
.chemical-structure img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 2px;
    background: #ffffff;
    display: block;
}

/* Container for image to handle overflow */
.chemical-structure > img {
    overflow: hidden;
    border-radius: 2px;
}

/* Kekule Viewer Styling */
.chemical-structure .kekule-viewer {
    border: none !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
}

.chemical-structure .kekule-viewer canvas {
    border-radius: 2px;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chemical-structure {
        margin-right: 10px;
        margin-bottom: 15px;
        min-width: 150px;
        min-height: 120px;
        padding: 10px;
    }
    
    .formula-display {
        font-size: 1.2rem;
    }
    
    .structure-title {
        font-size: 0.8rem;
    }
}

/* Integration with substance detail page */
.fiu-substance-detail .chemical-structure {
    margin-right: 0;
    margin-bottom: 20px;
    float: left;
    clear: both;
}

/* Clear float after chemical structure */
.fiu-substance-detail .chemical-structure::after {
    content: "";
    display: table;
    clear: both;
}

/* Hover effects */
.chemical-structure:hover {
    background: #f8f9fa;
    border-color: #34495e;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Loading state */
.chemical-structure.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error state */
.chemical-structure.error {
    background: #fef2f2;
    border-color: #fca5a5;
}

.chemical-structure.error .formula-display {
    color: #dc2626;
}

/* Success state */
.chemical-structure.success {
    background: #ffffff;
    border-color: #27ae60;
}

.chemical-structure.success .formula-display {
    color: #2c3e50;
}
