/**
 * Substanz-System Widget Styles
 */

/* Common Widget Styles */
.gasprobenentnahme-widget {
    font-family: 'Inter', sans-serif;
    color: #203556;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.gasprobenentnahme-header {
    background-color: #07777F;
    padding: 15px;
}

.gasprobenentnahme-title {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.gasprobenentnahme-content {
    padding: 20px;
}

.gasprobenentnahme-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.chemical-formula {
    font-family: 'Roboto Mono', monospace;
    font-weight: 400;
}

/* Advanced Widget Styles */
.gasprobenentnahme-advanced {
    max-width: 1200px;
    margin: 0 auto;
}

.gasprobenentnahme-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
}

.gasprobenentnahme-search {
    position: relative;
    flex-basis: 100%;
    margin-bottom: 15px;
}

.gasprobenentnahme-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    color: #203556;
    transition: border-color 0.3s;
}

.gasprobenentnahme-search input:focus {
    outline: none;
    border-color: #07777F;
    box-shadow: 0 0 0 2px rgba(7, 119, 127, 0.1);
}

.gasprobenentnahme-search:before {
    content: '🔍';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
}

.gasprobenentnahme-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-grow: 1;
}

.gasprobenentnahme-filter-button {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    color: #203556;
    cursor: pointer;
    transition: all 0.3s;
}

.gasprobenentnahme-filter-button:hover {
    background-color: #f0f0f0;
}

.gasprobenentnahme-filter-button.active {
    background-color: #07777F;
    color: #fff;
    border-color: #07777F;
}

.gasprobenentnahme-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #07777F #f0f0f0;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.gasprobenentnahme-tabs::-webkit-scrollbar {
    height: 6px;
}

.gasprobenentnahme-tabs::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.gasprobenentnahme-tabs::-webkit-scrollbar-thumb {
    background-color: #07777F;
    border-radius: 6px;
}

.gasprobenentnahme-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.gasprobenentnahme-tab:hover {
    background-color: #f5f5f5;
}

.gasprobenentnahme-tab.active {
    border-bottom-color: #07777F;
    color: #07777F;
}

.gasprobenentnahme-tab-badge {
    display: inline-block;
    margin-left: 5px;
    background-color: #e0e0e0;
    color: #203556;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: normal;
}

.gasprobenentnahme-tab.active .gasprobenentnahme-tab-badge {
    background-color: #07777F;
    color: #fff;
}

.gasprobenentnahme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gasprobenentnahme-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.gasprobenentnahme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gasprobenentnahme-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #07777F;
}

.gasprobenentnahme-card-formula {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.gasprobenentnahme-card-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.gasprobenentnahme-card-label {
    color: #666;
}

.gasprobenentnahme-card-value {
    font-weight: 500;
}

.gasprobenentnahme-card-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e0f2f3;
    color: #07777F;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 15px;
}

.gasprobenentnahme-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 10px;
}

.gasprobenentnahme-page-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #203556;
    cursor: pointer;
    transition: all 0.3s;
}

.gasprobenentnahme-page-button:hover {
    background-color: #f5f5f5;
}

.gasprobenentnahme-page-button.active {
    background-color: #07777F;
    color: #fff;
    border-color: #07777F;
}

.gasprobenentnahme-no-results {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-size: 16px;
}

.gasprobenentnahme-no-results-icon {
    font-size: 40px;
    margin-bottom: 20px;
    color: #ddd;
}

/* Loading state */
.gasprobenentnahme-loading {
    position: relative;
    min-height: 150px;
}

.gasprobenentnahme-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    margin-left: -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #07777F;
    border-radius: 50%;
    animation: gasprobenentnahme-spin 1s linear infinite;
}

@keyframes gasprobenentnahme-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty and error states */
.gasprobenentnahme-empty,
.gasprobenentnahme-error {
    padding: 20px;
    text-align: center;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.gasprobenentnahme-error {
    border-left: 4px solid #e74c3c;
}

/* Table Widget Styles */
.gasprobenentnahme-table-wrapper {
    overflow-x: auto;
}

.gasprobenentnahme-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
}

.gasprobenentnahme-table th,
.gasprobenentnahme-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.gasprobenentnahme-table th {
    background-color: #f5f5f5;
    font-weight: 500;
    color: #203556;
    font-size: 13px;
    text-transform: uppercase;
}

.gasprobenentnahme-table tr:nth-child(even) {
    background-color: #fafafa;
}

.gasprobenentnahme-table tr:hover {
    background-color: rgba(7, 119, 127, 0.05);
}

/* Popup Widget Styles */
.gasprobenentnahme-popup-trigger {
    display: inline-block;
    padding: 10px 20px;
    background-color: #07777F;
    color: white;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.gasprobenentnahme-popup-trigger:hover {
    background-color: #00B9BC;
}

.gasprobenentnahme-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.gasprobenentnahme-popup-active {
    display: flex;
}

.gasprobenentnahme-popup-content {
    position: relative;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gasprobenentnahme-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #f3f3f3;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    transition: background-color 0.3s;
}

.gasprobenentnahme-popup-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

.gasprobenentnahme-popup-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #203556;
    padding-right: 40px;
}

.gasprobenentnahme-popup-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

body.gasprobenentnahme-popup-open {
    overflow: hidden;
}

/* Inline Widget Styles */
.gasprobenentnahme-inline-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 20px;
}

.gasprobenentnahme-inline-item {
    background-color: #f9f9f9;
    border-left: 3px solid #07777F;
    padding: 15px;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gasprobenentnahme-inline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gasprobenentnahme-inline-name {
    font-weight: 600;
    margin-bottom: 10px;
}

.gasprobenentnahme-inline-formula {
    font-weight: 400;
    margin-bottom: 10px;
    color: #07777F;
}

.gasprobenentnahme-inline-detection,
.gasprobenentnahme-inline-measurement {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

/* Substance card styles */
.substance-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Flexbox-Layout für untereinander stehende Werte */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS - MOBILE FIRST
   ========================================================================== */

/* Mobile Base Styles (320px+) */
.gasprobenentnahme-widget {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gasprobenentnahme-popup-content {
    width: 95%;
    max-width: 95%;
    max-height: 80vh;
    margin: 20px auto;
}

/* Small Mobile (480px+) */
@media (min-width: 480px) {
    .gasprobenentnahme-popup-content {
        width: 90%;
        max-width: 90%;
    }
}

/* Tablet Portrait (768px+) */
@media (min-width: 768px) {
    .gasprobenentnahme-inline-content {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .gasprobenentnahme-popup-content {
        width: 80%;
        max-width: 80%;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .gasprobenentnahme-inline-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gasprobenentnahme-popup-content {
        width: 70%;
        max-width: 70%;
    }
}

/* ==========================================================================
   TOUCH OPTIMIZATIONS
   ========================================================================== */

/* Touch-friendly button sizes for mobile */
@media (max-width: 767px) {
    .gasprobenentnahme-popup-trigger,
    .gasprobenentnahme-filter-button,
    .gasprobenentnahme-page-button {
        min-height: 44px; /* iOS touch target minimum */
        padding: 12px 20px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .gasprobenentnahme-tab {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .gasprobenentnahme-popup-close {
        width: 44px;
        height: 44px;
    }
}