/**
 * Style CSS dla wtyczki AKS WooStats
 */

/* Główny kontener widżetu */
#woo-stats-widget-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Sekcja dzisiejszych statystyk */
.woo-stats-today {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.woo-stats-today div {
    width: 48%;
    text-align: center;
}

.woo-stats-today h3 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.woo-stats-today p {
    font-size: 48px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Sekcja statystyk dla wybranego okresu */
.woo-stats-period {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    border-radius: 8px;
    color: white;
}

.woo-stats-period div {
    width: 48%;
    text-align: center;
}

.woo-stats-period h3 {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.woo-stats-period p {
    font-size: 42px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Filtry */
.woo-stats-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    background-color: #f8f9fa;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.woo-stats-filters > div {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.woo-stats-filters label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.woo-stats-filters select {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.woo-stats-filters select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Przyciski akcji */
.woo-stats-actions {
    text-align: center;
    margin-top: 15px;
}

.woo-stats-actions button {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.woo-stats-actions button:hover:not(:disabled) {
    background-color: #005a87;
}

.woo-stats-actions button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Pasek postępu */
.woo-stats-progress {
    margin-top: 15px;
    text-align: center;
}

.woo-stats-progress-bar {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 25px;
    overflow: hidden;
    margin: 10px 0;
    height: 25px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.woo-stats-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 25px;
    position: relative;
}

.woo-stats-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* Komunikaty */
.woo-stats-message {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Powiadomienia */
.woo-stats-notification {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 6px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.woo-stats-notification-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woo-stats-notification-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.woo-stats-notification-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Statystyki bazy danych */
.woo-stats-db-stats {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.woo-stats-db-stats h4 {
    margin-top: 0;
    color: #495057;
}

.woo-stats-db-stats p {
    margin: 8px 0;
    color: #6c757d;
}

.woo-stats-db-stats strong {
    color: #495057;
}

/* Wersja wtyczki */
.woo-stats-version {
    text-align: center;
    margin-top: 15px;
    font-size: 12px;
    color: #6c757d;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Błędy */
.woo-stats-error {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

/* Logi debugowania */
.woo-stats-debug {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 400px;
    overflow-y: auto;
}

.woo-stats-debug h2 {
    margin-top: 0;
    color: #495057;
}

.woo-stats-debug pre {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    overflow-x: auto;
}

/* Wykres */
#wooStatsChart {
    margin: 20px auto;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .woo-stats-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .woo-stats-filters > div {
        min-width: auto;
    }
    
    .woo-stats-today, .woo-stats-period {
        flex-direction: column;
        text-align: center;
    }
    
    .woo-stats-today div, .woo-stats-period div {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .woo-stats-today p {
        font-size: 36px;
    }
    
    .woo-stats-period p {
        font-size: 32px;
    }
    
    #wooStatsChart {
        width: 100% !important;
        height: 300px !important;
    }
}

/* Animacje */
.woo-stats-today div, .woo-stats-period div {
    animation: fadeInUp 0.6s ease-out;
}

.woo-stats-today div:nth-child(2), .woo-stats-period div:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin panel specific styles */
.aks-api-status {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.aks-api-status h3 {
    margin-top: 0;
    color: #495057;
}

.aks-export-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.aks-export-section h3 {
    margin-top: 0;
    color: #495057;
}

/* Tooltips */
.woo-stats-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.woo-stats-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.woo-stats-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.woo-stats-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading spinner */
.woo-stats-spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #007cba;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}