/* Bierdop Matcher 2 - Gebroken Wit Thema - Versie 1.8 */
.bm2-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.bm2-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;
}

.bm2-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: #495057;
}

.bm2-subtitle {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.8;
    font-weight: 400;
    color: #6c757d;
}

.bm2-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;
}

.bm2-card-title {
    font-size: 1.5em;
    margin: 0 0 20px 0;
    color: #495057;
    font-weight: 600;
}

/* Form Styles */
.bm2-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bm2-file-upload {
    margin-bottom: 10px;
}

.bm2-file-label {
    cursor: pointer;
    display: block;
}

.bm2-file-input {
    display: none;
}

.bm2-file-area {
    border: 3px dashed #ced4da;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.bm2-file-area:hover {
    border-color: #adb5bd;
    background: #e9ecef;
}

.bm2-file-input:focus + .bm2-file-area {
    border-color: #adb5bd;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.1);
}

.bm2-file-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
    color: #6c757d;
}

.bm2-file-text {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.bm2-file-hint {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
}

/* Button Styles */
.bm2-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;
}

.bm2-button-primary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.bm2-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.bm2-button-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.bm2-button-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* Results Styles */
.bm2-results {
    margin-top: 30px;
}

.bm2-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);
}

.bm2-matches-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
}

/* Grid voor matches - 3 KOLOMMEN voor 2 rijen van 3 foto's */
.bm2-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.bm2-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;
}

.bm2-match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.bm2-match-image-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.bm2-match-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bm2-match-card:hover .bm2-match-image {
    transform: scale(1.05);
}

.bm2-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;
}

.bm2-score-high { background: rgba(40, 167, 69, 0.9); }
.bm2-score-medium { background: rgba(255, 193, 7, 0.9); }
.bm2-score-low { background: rgba(220, 53, 69, 0.9); }

.bm2-match-info {
    padding: 20px;
}

.bm2-match-field {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #495057;
    line-height: 1.4;
}

.bm2-match-field strong {
    color: #343a40;
}

/* Lightbox Styles */
.bm2-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bm2-lightbox.active {
    display: flex;
    opacity: 1;
}

.bm2-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.bm2-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.bm2-lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bm2-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.bm2-lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.1em;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

/* Message Styles */
.bm2-message {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.5;
}

.bm2-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bm2-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bm2-message-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.bm2-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Upload Preview */
.bm2-uploaded-preview {
    text-align: center;
    margin: 20px 0;
}

.bm2-preview-image {
    max-width: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* Add Form Styles */
.bm2-add-form-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.bm2-add-form-title {
    font-size: 1.4em;
    margin: 0 0 20px 0;
    color: #495057;
    font-weight: 600;
}

.bm2-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.bm2-form-group {
    display: flex;
    flex-direction: column;
}

.bm2-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.bm2-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.bm2-input:focus {
    outline: none;
    border-color: #adb5bd;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.1);
}

.bm2-input::placeholder {
    color: #6c757d;
}

/* Preview Styles */
.bm2-preview-container {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.bm2-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bm2-preview-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.bm2-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;
}

.bm2-remove-preview:hover {
    background: #f8d7da;
}

.bm2-preview-image-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

.bm2-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;
}

.bm2-preview-hint {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* Button Loading State */
.bm2-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.bm2-button-loading {
    position: relative;
    pointer-events: none;
}

.bm2-button-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: bm2-spin 1s linear infinite;
}

@keyframes bm2-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File input drag & drop improvements */
.bm2-file-area.dragover {
    border-color: #adb5bd;
    background: #e9ecef;
    transform: scale(1.02);
}

/* List specific styles */
.bm2-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.bm2-list-stats {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.bm2-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bm2-sort-controls label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.bm2-sort-controls select {
    width: auto;
    min-width: 150px;
}

/* No matches styling */
.bm2-no-matches {
    text-align: center;
    padding: 40px;
}

.bm2-fallback-text {
    font-size: 1.1em;
    color: #495057;
    margin-top: 20px;
}

.bm2-fallback {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* View Controls */
.bm2-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;
}

.bm2-view-buttons {
    display: flex;
    gap: 12px;
}

.bm2-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;
}

.bm2-view-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #adb5bd;
}

.bm2-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;
}

.bm2-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);
}

.bm2-view-icon {
    font-size: 1.2em;
}

.bm2-view-text {
    white-space: nowrap;
}

/* Nieuwe List View Styles */
.bm2-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.bm2-list-item-row {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    gap: 20px;
}

.bm2-list-item-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.bm2-list-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.bm2-list-item-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.bm2-list-item-thumbnail:hover {
    transform: scale(1.05);
}

.bm2-list-item-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
}

.bm2-list-item-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bm2-list-item-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    min-width: 80px;
}

.bm2-list-item-value {
    color: #495057;
    font-size: 0.95em;
}

/* Grid View Container */
.bm2-grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .bm2-grid-view {
        grid-template-columns: 1fr;
    }
    
    .bm2-list-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .bm2-list-item-image {
        width: 60px;
        height: 60px;
    }
    
    .bm2-list-item-info {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }
    
    .bm2-list-item-field {
        justify-content: space-between;
    }
    
    .bm2-list-item-label {
        min-width: 70px;
    }
    
    .bm2-view-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .bm2-view-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .bm2-view-button {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bm2-grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .bm2-grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* RESPONSIVE DESIGN - MOBIEL EERST */
@media (max-width: 768px) {
    .bm2-container {
        padding: 15px;
    }
    
    .bm2-title {
        font-size: 2em;
    }
    
    .bm2-card,
    .bm2-add-form-container {
        padding: 20px;
    }
    
    /* Op mobiel: 1 kolom */
    .bm2-grid {
        grid-template-columns: 1fr;
    }
    
    .bm2-form-grid {
        grid-template-columns: 1fr;
    }
    
    .bm2-button {
        width: 100%;
    }
    
    .bm2-preview-container {
        padding: 15px;
    }
    
    .bm2-preview-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .bm2-sort-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bm2-sort-controls select {
        width: 100%;
    }
    
    .bm2-match-image {
        height: 180px;
    }
    
    /* Lightbox aanpassingen voor mobiel */
    .bm2-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }
    
    .bm2-lightbox-caption {
        bottom: 10px;
        left: 10px;
        right: 10px;
        font-size: 1em;
    }
}

/* Voor tablets: 2 kolommen */
@media (min-width: 769px) and (max-width: 1024px) {
    .bm2-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Voor desktop: 3 kolommen (2 rijen van 3) */
@media (min-width: 1025px) {
    .bm2-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Aanpassing voor de form-grid om beter om te gaan met 6 velden */
@media (min-width: 768px) {
    .bm2-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bm2-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Focus states for accessibility */
.bm2-button:focus,
.bm2-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.3);
}

/* Force 3 columns for matches grid */
.bm2-matches .bm2-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Empty state styling */
.bm2-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.bm2-empty-state .bm2-file-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.bm2-empty-state h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #495057;
}

.bm2-empty-state p {
    font-size: 1em;
    line-height: 1.5;
}