/**
 * DTF Custom Uploader Plugin - Stylesheet
 * Version: 1.3.1 - Mit Bondrucker-Unterstützung und erweiterter QR-Code und Barcode-Funktionalität
 */

/* Barcode-Darstellung in der Bestellübersicht */
.dtf-barcode-container {
    margin: 15px 0;
    text-align: center;
}

.dtf-barcode-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* QR-Code für Bestellübersicht */
.dtf-order-qrcode {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
}

.dtf-order-qrcode h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.dtf-qrcode-image {
    margin: 10px auto;
    max-width: 150px;
}

.dtf-qrcode-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Thermodruck-Styles */
.dtf-thermal-print-button {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
}

.dtf-thermal-print-button .dashicons {
    margin-right: 5px;
}

.dtf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.dtf-modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.dtf-modal-container {
    position: relative;
    max-width: 600px;
    margin: 50px auto;
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.dtf-modal-header {
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dtf-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.dtf-modal-close {
    cursor: pointer;
    font-size: 20px;
    border: none;
    background: none;
    color: #999;
}

.dtf-modal-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.dtf-modal-footer {
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    text-align: right;
}

.dtf-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.dtf-success-message {
    background-color: #dff0d8;
    color: #3c763d;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
}

.dtf-error-message {
    background-color: #f2dede;
    color: #a94442;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Allgemeine Styling */
.dtf-uploader-container,
.dtf-orders-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.dtf-uploader-container h2,
.dtf-orders-container h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

/* Formular Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    box-sizing: border-box;
}

.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input[type="number"] {
    max-width: 200px;
}

/* Bei den Maßen die Einheiten direkt neben den Feldern anzeigen */
input.scaled-width,
input.scaled-height {
    display: inline-block;
    width: 150px;
    box-sizing: border-box;
}

.unit-label {
    margin-left: 5px;
    font-weight: bold;
}

/* Fortschrittsbalken für Upload */
.upload-progress {
    margin-top: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    background-color: #4CAF50;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
}

/* Dateivorschau Styling */
#file-preview {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #4a90e2;
}

/* Style für alle Vorschaubilder */
#preview-image, .preview-image {
    max-width: 300px;
    max-height: 300px;
    border: 1px solid #ddd;
    padding: 3px;
    background: #fff;
    margin-bottom: 15px;
    /* Hintergrund für weiße Bilder - Schachbrettmuster */
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Container für hochgeladene Dateien */
#uploaded-files-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* Styling für jeden Datei-Eintrag */
.file-entry {
    flex: 1 1 400px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.file-meta {
    margin-bottom: 20px;
}

.dimensions-info {
    margin-bottom: 15px;
}

/* DPI-Anzeige Styling */
.dpi-info {
    margin-top: 10px;
}

.dpi-indicator {
    height: 10px;
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 5px;
    position: relative;
}

#dpi-quality-indicator {
    height: 100%;
    width: 0;
    border-radius: 5px;
    background: linear-gradient(to right, #f44336, #ffeb3b, #4CAF50);
}

/* Preisberechnung Styling */
.price-calculation {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.price-calculation h3 {
    margin-top: 0;
    color: #333;
}

/* Buttons Styling */
.dtf-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #0056b3; /* Dunkleres Blau für besseren Kontrast */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dtf-button:hover {
    background-color: #003d82; /* Noch dunkleres Blau für den Hover-Zustand */
    color: white;
    text-decoration: none;
}

.dtf-button:focus {
    outline: 3px solid #4caf50; /* Fokusumriss für Tastaturnavigation */
    outline-offset: 2px;
}

.form-actions {
    margin-top: 20px;
}

/* Login-Formular Styling */
.dtf-login-notice {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #ddd;
}

.dtf-login-notice p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.dtf-login-notice .login-submit {
    margin-top: 15px;
}

/* Erfolgsmeldung Styling */
#order-success {
    padding: 20px;
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    margin-top: 20px;
    text-align: center;
}

/* Bestellungsanzeige Styling */
.dtf-orders-list {
    margin-top: 20px;
}

.dtf-order-item {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.order-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.order-header h3 {
    margin: 0;
    font-size: 18px;
}

.order-date {
    color: #666;
    margin: 0;
}

.order-status {
    margin: 0;
}

.status-pending {
    color: #ff9800;
    padding: 5px 10px;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
}

.status-processing {
    color: #2196F3;
    padding: 5px 10px;
    background-color: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
}

.status-completed {
    color: #4CAF50;
    padding: 5px 10px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
}

.status-cancelled {
    color: #f44336;
    padding: 5px 10px;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
}

.order-items {
    margin-bottom: 15px;
}

.order-items h4 {
    margin-top: 0;
    font-size: 16px;
}

.item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.order-item {
    flex: 1 1 300px;
    padding: 15px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.item-preview {
    margin-bottom: 10px;
}

.item-preview img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #ddd;
    padding: 3px;
}

.item-details p {
    margin: 5px 0;
}

.order-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.order-total {
    font-size: 18px;
    text-align: right;
}

.order-notes {
    margin-top: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .dtf-uploader-container,
    .dtf-orders-container {
        padding: 15px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-header > * {
        margin-bottom: 10px;
    }
    
    .item-list {
        flex-direction: column;
    }
    
    .order-item {
        flex: 1 1 100%;
    }
    
    /* Upload-Container für mehrere Dateien */
    #uploaded-files-container {
        display: flex;
        flex-direction: column;
    }
    
    .file-entry {
        margin-bottom: 25px;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    
    input.scaled-width,
    input.scaled-height {
        width: calc(100% - 40px); /* Platz für das Einheitslabel */
        max-width: 180px;
    }
    
    .preview-image {
        max-width: 100%;
        height: auto;
    }
}

/* Für noch kleinere Geräte */
@media (max-width: 480px) {
    .dtf-uploader-container,
    .dtf-orders-container {
        padding: 10px;
    }
    
    .form-group input[type="number"] {
        max-width: 100%;
        width: calc(100% - 40px);
    }
    
    .price-calculation {
        padding: 10px;
    }
}

/* Admin-Styling */
.wp-admin .dtf-status-filter {
    margin-bottom: 15px;
}

.wp-admin .status-pending,
.wp-admin .status-processing,
.wp-admin .status-completed,
.wp-admin .status-cancelled {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
}

#order-details-modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Neue Admin-Styling für Bestellübersicht */
.delete-order {
    color: white !important;
    background-color: #d9534f !important;
    border-color: #d43f3a !important;
}

.delete-order:hover {
    background-color: #c9302c !important;
}

.order-status-select {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.order-status-select option[value="pending"] { color: #ff9800; }
.order-status-select option[value="processing"] { color: #2196F3; }
.order-status-select option[value="completed"] { color: #4CAF50; }
.order-status-select option[value="cancelled"] { color: #f44336; }

.status-updated {
    animation: highlight 2s;
}

@keyframes highlight {
    0% { background-color: #ffffc3; }
    100% { background-color: transparent; }
}

/* Für Screenreader versteckte Texte */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Verbesserte Formularfeld-Fokus für Barrierefreiheit */
input:focus, 
select:focus, 
textarea:focus,
button:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}