/* PartenerViva Product Importer - Admin Styles */

/* Dashboard Grid */
.pvi-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Cards */
.pvi-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.pvi-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

.pvi-card h3 {
    font-size: 14px;
    margin-top: 20px;
}

/* Import Card */
.pvi-import-card {
    grid-column: 1 / -1;
}

.pvi-import-status {
    padding: 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.pvi-status-idle {
    color: #666;
}

.pvi-status-running {
    color: #0073aa;
    font-weight: 600;
}

.pvi-status-completed {
    color: #46b450;
    font-weight: 600;
}

.pvi-status-failed {
    color: #dc3232;
    font-weight: 600;
}

.pvi-status-stopped {
    color: #f0b849;
    font-weight: 600;
}

.pvi-import-progress {
    margin: 20px 0;
}

.pvi-progress-bar {
    height: 30px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pvi-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #2271b1);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.pvi-progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.pvi-import-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.pvi-import-actions .button {
    flex: 1;
}

.pvi-import-actions .dashicons {
    margin-top: 3px;
}

#pvi-stop-import {
    background: #dc3232;
    border-color: #dc3232;
    color: #fff;
}

#pvi-stop-import:hover {
    background: #c62828;
    border-color: #c62828;
}

#pvi-stop-import:disabled {
    background: #f0f0f1;
    border-color: #dcdcde;
    color: #a7aaad;
}

.pvi-last-import {
    margin-top: 20px;
}

.pvi-last-import table {
    margin-top: 10px;
}

.pvi-last-import th {
    width: 120px;
    text-align: left;
    font-weight: 600;
}

/* Status Labels */
.pvi-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.pvi-status-completed {
    background: #d4edda;
    color: #155724;
}

.pvi-status-running {
    background: #d1ecf1;
    color: #0c5460;
}

.pvi-status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Statistics */
.pvi-stat-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.pvi-stat-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.pvi-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1;
}

.pvi-stat-label {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pvi-last-sync {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Schedule */
.pvi-schedule-status {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pvi-schedule-active {
    background: #d4edda;
    color: #155724;
}

.pvi-schedule-inactive {
    background: #fff3cd;
    color: #856404;
}

.pvi-schedule-status .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Quick Links */
.pvi-quick-links {
    list-style: none;
    margin: 10px 0;
    padding: 0;
}

.pvi-quick-links li {
    margin: 0;
    padding: 0;
}

.pvi-quick-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    text-decoration: none;
    color: #2271b1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.pvi-quick-links a:hover {
    background: #f0f0f1;
}

.pvi-quick-links .dashicons {
    color: #666;
}

/* Feed Info */
.pvi-feed-info {
    margin-top: 20px;
}

.pvi-feed-info code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Settings */
.pvi-settings-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.form-table th {
    width: 250px;
}

/* Log */
.pvi-log-actions {
    margin: 20px 0;
}

.pvi-log-actions .button {
    margin-right: 10px;
}

.pvi-empty-log {
    padding: 40px;
    text-align: center;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-top: 20px;
}

.pvi-log-table {
    margin-top: 20px;
}

.pvi-log-table .column-date {
    width: 180px;
}

.pvi-log-table .column-status {
    width: 100px;
}

.pvi-log-table .column-processed,
.pvi-log-table .column-created,
.pvi-log-table .column-updated,
.pvi-log-table .column-failed {
    width: 80px;
    text-align: center;
}

.pvi-time-ago {
    color: #999;
}

.pvi-count {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
}

.pvi-count-created {
    background: #d4edda;
    color: #155724;
}

.pvi-count-updated {
    background: #d1ecf1;
    color: #0c5460;
}

.pvi-count-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Help */
.pvi-help h3 {
    margin-top: 20px;
    font-size: 15px;
}

.pvi-help ol,
.pvi-help ul {
    margin-left: 20px;
}

.pvi-help li {
    margin: 8px 0;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .pvi-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .pvi-stat-boxes {
        grid-template-columns: 1fr;
    }
    
    .pvi-import-actions {
        flex-direction: column;
    }
}

/* Loading State */
.pvi-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pvi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: pvi-spin 1s linear infinite;
}

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

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

/* Frontend: GPSR Info in Additional Information */
.woocommerce-product-attributes-item--gpsr_info .woocommerce-product-attributes-item__value {
    line-height: 1.6;
}

.woocommerce-product-attributes-item--gpsr_info .woocommerce-product-attributes-item__value p {
    margin: 0 0 10px 0;
}

.woocommerce-product-attributes-item--gpsr_info .woocommerce-product-attributes-item__value p:last-child {
    margin-bottom: 0;
}

/* GPSR Tab Content */
.pvi-gpsr-content {
    padding: 20px 0;
    line-height: 1.6;
}

.pvi-gpsr-content p {
    margin: 0 0 15px 0;
}

.pvi-gpsr-content p:last-child {
    margin-bottom: 0;
}

.pvi-gpsr-content ul,
.pvi-gpsr-content ol {
    margin: 0 0 15px 20px;
}

.pvi-gpsr-content li {
    margin-bottom: 8px;
}
