/* USB Auswertungen Dashboard Styles */
#usb-sales-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
}

.dashboard-header h2 {
    color: #23282d;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.dashboard-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.dashboard-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-change {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: #46b450;
}

.stat-change.negative {
    color: #dc3232;
}

.stat-change.neutral {
    color: #666;
}

.stat-change::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 5px;
}

.stat-change.positive::before {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #46b450;
}

.stat-change.negative::before {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #dc3232;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container.chart-large {
    grid-column: 1 / -1;
    min-height: 400px;
    max-height: 450px;
}

.chart-container.chart-large canvas {
    max-height: 350px;
    width: 100% !important;
    height: 350px !important;
}

.chart-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.chart-container h3 {
    margin: 0 0 20px 0;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.chart-container canvas {
    max-height: 400px;
}

.dashboard-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dashboard-loading p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .chart-small-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .chart-container {
        padding: 20px;
    }

    .chart-container.chart-large {
        min-height: 300px;
        max-height: 350px;
    }

    .chart-container.chart-large canvas {
        max-height: 250px !important;
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    #usb-sales-dashboard {
        padding: 15px;
    }
    
    .dashboard-header h2 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .dashboard-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .dashboard-controls select,
    .dashboard-controls button {
        width: 100%;
    }

    .chart-container.chart-large {
        min-height: 250px;
        max-height: 300px;
    }

    .chart-container.chart-large canvas {
        max-height: 200px !important;
        height: 200px !important;
    }
}

/* WordPress admin specific styles */
.wp-admin #usb-sales-dashboard {
    background: #f1f1f1;
    margin: -20px -20px 0 -20px;
    padding: 30px;
}

.wp-admin .stat-card,
.wp-admin .chart-container {
    background: #fff;
}

/* Button styling */
.button.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
}

.button.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.button.button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    box-shadow: 0 0 0 1px #135e96;
}

/* Error message styling */
.error-message {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #3c434a;
}

.success-message {
    background: #f0f6fc;
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #3c434a;
}
