/* Bierdop Matcher 3 - Gebroken Wit Thema - Versie 1.1 */
.bm3-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.bm3-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    color: #495057;
    border: 1px solid #dee2e6;
}

.bm3-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: #495057;
}

.bm3-subtitle {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.8;
    font-weight: 400;
    color: #6c757d;
}

.bm3-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.bm3-card-title {
    font-size: 1.5em;
    margin: 0 0 20px 0;
    color: #495057;
    font-weight: 600;
}

/* Form Styles */
.bm3-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bm3-file-upload {
    margin-bottom: 10px;
}

.bm3-file-label {
    cursor: pointer;
    display: block;
}

.bm3-file-input {
    display: none;
}

.bm3-file-area {
    border: 3px dashed #ced4da;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.bm3-file-area:hover {
    border-color: #adb5bd;
    background: #e9ecef;
}

.bm3-file-input:focus + .bm3-file-area {
    border-color: #adb5bd;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.1);
}

.bm3-file-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
    color: #6c757d;
}

.bm3-file-text {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.bm3-file-hint {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
}

/* Etiket upload specifieke styling - ALLEEN IN TOEVOEGFORMULIER */
.bm3-file-upload-small .bm3-file-area {
    padding: 20px 15px;
}

.bm3-file-area-small {
    border: 2px dashed #ced4da;
}

.bm3-form-group-full {
    grid-column: 1 / -1;
}

.bm3-preview-container-small {
    margin: 15px 0;
    padding: 15px;
}

.bm3-preview-container-small .bm3-preview-image {
    max-width: 150px;
    max-height: 150px;
}

/* Drag & drop verbeteringen voor etiket */
.bm3-file-area-small.dragover {
    border-color: #28a745;
    background: #d4edda;
}

/* Button Styles */
.bm3-button {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bm3-button-primary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.bm3-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.bm3-button-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.bm3-button-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* Results Styles */
.bm3-results {
    margin-top: 30px;
}

.bm3-loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #6c757d;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.bm3-matches-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
}

/* UNIFORME GRID STYLING - ZELFDE FORMAAT VOOR ALLE GRIDS */
.bm3-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.bm3-match-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.bm3-match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.bm3-match-image-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.bm3-match-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bm3-match-card:hover .bm3-match-image {
    transform: scale(1.05);
}

.bm3-score {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    color: white;
    z-index: 2;
}

.bm3-score-high { background: rgba(40, 167, 69, 0.9); }
.bm3-score-medium { background: rgba(255, 193, 7, 0.9); }
.bm3-score-low { background: rgba(220, 53, 69, 0.9); }

/* Etiket indicator en button styling */
.bm3-etiket-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bm3-etiket-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.bm3-etiket-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.bm3-match-info {
    padding: 20px;
}

.bm3-match-field {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #495057;
    line-height: 1.4;
}

.bm3-match-field strong {
    color: #343a40;
}

/* Message Styles */
.bm3-message {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.5;
}

.bm3-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bm3-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bm3-message-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.bm3-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Upload Preview */
.bm3-uploaded-preview {
    text-align: center;
    margin: 20px 0;
}

.bm3-preview-image {
    max-width: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* VERBETERDE ADD FORM STYLES - OPGELOST BORDER PROBLEEM */
.bm3-add-form-container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #e9ecef;
    min-height: auto;
    overflow: visible;
}

.bm3-add-form-title {
    font-size: 1.4em;
    margin: 0 0 25px 0;
    color: #495057;
    font-weight: 600;
}

/* Specifieke styling voor het toevoegformulier grid */
.bm3-add-form-container .bm3-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .bm3-add-form-container .bm3-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bm3-add-form-container .bm3-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Zorg dat inputs altijd binnen de border passen */
.bm3-add-form-container .bm3-input {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

/* Verbeterde spacing voor form groups */
.bm3-add-form-container .bm3-form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Algemene form grid styles (voor andere formulieren) */
.bm3-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .bm3-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bm3-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bm3-form-group {
    display: flex;
    flex-direction: column;
}

.bm3-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.bm3-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.bm3-input:focus {
    outline: none;
    border-color: #adb5bd;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.1);
}

.bm3-input::placeholder {
    color: #6c757d;
}

/* Preview Styles */
.bm3-preview-container {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.bm3-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bm3-preview-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.bm3-remove-preview {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.bm3-remove-preview:hover {
    background: #f8d7da;
}

.bm3-preview-image-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

.bm3-preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    cursor: pointer;
}

.bm3-preview-hint {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* Button Loading State */
.bm3-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.bm3-button-loading {
    position: relative;
    pointer-events: none;
}

.bm3-button-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: bm3-spin 1s linear infinite;
}

@keyframes bm3-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File input drag & drop improvements */
.bm3-file-area.dragover {
    border-color: #adb5bd;
    background: #e9ecef;
    transform: scale(1.02);
}

/* List specific styles */
.bm3-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.bm3-list-stats {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.bm3-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bm3-sort-controls label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.bm3-sort-controls select {
    width: auto;
    min-width: 150px;
}

/* No matches styling */
.bm3-no-matches {
    text-align: center;
    padding: 40px;
}

.bm3-fallback-text {
    font-size: 1.1em;
    color: #495057;
    margin-top: 20px;
}

.bm3-fallback {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* View Controls */
.bm3-view-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.bm3-view-buttons {
    display: flex;
    gap: 12px;
}

.bm3-view-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
}

.bm3-view-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #adb5bd;
}

.bm3-view-button-active {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
    border-color: #495057;
}

.bm3-view-button-active:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.bm3-view-icon {
    font-size: 1.2em;
}

.bm3-view-text {
    white-space: nowrap;
}

/* VERBETERDE LIST VIEW STYLES - DUIDELIJK ZICHTBARE AANPASSINGEN */
.bm3-list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.bm3-list-item-row {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    gap: 25px;
    line-height: 1.8;
}

.bm3-list-item-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.bm3-list-item-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
}

.bm3-list-item-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.bm3-list-item-thumbnail:hover {
    transform: scale(1.08);
}

.bm3-list-item-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 35px;
}

.bm3-list-item-field {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 2.0;
    min-height: 32px;
    padding: 5px 0;
    border-bottom: 1px solid #f8f9fa;
}

.bm3-list-item-field:last-child {
    border-bottom: none;
}

.bm3-list-item-label {
    font-weight: 700;
    color: #495057;
    font-size: 0.95em;
    min-width: 90px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
}

.bm3-list-item-value {
    color: #495057;
    font-size: 1em;
    line-height: 1.6;
    font-weight: 500;
}

/* Aanpassingen voor etiket in list view */
.bm3-list-item-field .bm3-etiket-button {
    margin-top: 5px;
}

/* UNIFORME GRID VIEW CONTAINER - ZELFDE ALS ZOEKRESULTATEN */
.bm3-grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .bm3-grid,
    .bm3-grid-view {
        grid-template-columns: 1fr;
    }
    
    .bm3-list-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }
    
    .bm3-list-item-image {
        width: 70px;
        height: 70px;
    }
    
    .bm3-list-item-info {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
    }
    
    .bm3-list-item-field {
        justify-content: space-between;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .bm3-list-item-label {
        min-width: auto;
        width: 100%;
    }
    
    .bm3-view-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .bm3-view-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .bm3-view-button {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
    }
    
    /* Mobiele aanpassingen voor het toevoegformulier */
    .bm3-add-form-container {
        padding: 25px 20px;
    }
    
    .bm3-add-form-container .bm3-form-grid {
        gap: 15px;
    }
    
    /* Responsive aanpassingen voor etiket */
    .bm3-file-upload-small .bm3-file-area {
        padding: 15px 10px;
    }
    
    .bm3-preview-container-small {
        padding: 12px;
    }
    
    .bm3-etiket-indicator {
        top: 5px;
        left: 5px;
        font-size: 0.7em;
        padding: 3px 6px;
    }
    
    .bm3-etiket-button {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bm3-grid,
    .bm3-grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .bm3-grid,
    .bm3-grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* RESPONSIVE DESIGN - MOBIEL EERST */
@media (max-width: 768px) {
    .bm3-container {
        padding: 15px;
    }
    
    .bm3-title {
        font-size: 2em;
    }
    
    .bm3-card,
    .bm3-add-form-container {
        padding: 20px;
    }
    
    /* Op mobiel: 1 kolom */
    .bm3-form-grid {
        grid-template-columns: 1fr;
    }
    
    .bm3-button {
        width: 100%;
    }
    
    .bm3-preview-container {
        padding: 15px;
    }
    
    .bm3-preview-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .bm3-sort-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bm3-sort-controls select {
        width: 100%;
    }
    
    .bm3-match-image {
        height: 180px;
    }
}

/* Voor tablets: 2 kolommen */
@media (min-width: 769px) and (max-width: 1024px) {
    .bm3-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Voor desktop: 3 kolommen */
@media (min-width: 1025px) {
    .bm3-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Focus states for accessibility */
.bm3-button:focus,
.bm3-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.3);
}

/* Empty state styling */
.bm3-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.bm3-empty-state .bm3-file-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.bm3-empty-state h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #495057;
}

.bm3-empty-state p {
    font-size: 1em;
    line-height: 1.5;
}

/* Verberg etiket indicator bovenop afbeeldingen - SPECIFIEK */
.bm3-match-image-container .bm3-etiket-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.bm3-list-item-image .bm3-etiket-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ============================================ */
/* WERKENDE LIGHTBOX - NIEUWE VERSIE */
/* ============================================ */

#bm3-lightbox {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 9999 !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Deze regel zorgt dat de lightbox zichtbaar wordt */
#bm3-lightbox[style*="display: block"] {
    display: flex !important;
}

#bm3-lightbox-image {
    max-width: 100% !important;
    max-height: 80vh !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5) !important;
}

#bm3-lightbox-close {
    position: absolute !important;
    top: -40px !important;
    right: -40px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: white !important;
    font-size: 2em !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

#bm3-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1) !important;
}

#bm3-lightbox-caption {
    position: absolute !important;
    bottom: -50px !important;
    left: 0 !important;
    right: 0 !important;
    text-align: center !important;
    color: white !important;
    font-size: 1.1em !important;
    padding: 10px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border-radius: 4px !important;
}

/* Mobile lightbox fixes */
@media (max-width: 768px) {
    #bm3-lightbox-close {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.5em !important;
    }
    
    #bm3-lightbox-caption {
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        font-size: 1em !important;
    }
    
    #bm3-lightbox-image {
        max-width: 95% !important;
        max-height: 70vh !important;
    }
}