/* Main Admin Wrapper */
.gspsync-admin-wrap {
    max-width: 1200px;
    margin: 20px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.gspsync-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: #fff;
}

.gspsync-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    color: #fff;
}

.gspsync-header-icon {
    margin-right: 15px;
    font-size: 32px;
}

.gspsync-premium-badge {
    background: #f39c12;
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.gspsync-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
    color: rgba(255,255,255,0.9);
}

/* Dashboard Grid */
.gspsync-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

/* Cards */
.gspsync-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e1e1;
    transition: box-shadow 0.3s ease;
}

.gspsync-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.gspsync-card-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e1e1;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gspsync-card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.gspsync-card-header h2 .dashicons {
    margin-right: 10px;
    color: #3498db;
}

.gspsync-card-content {
    padding: 25px;
}

/* Metal Tabs */
.gspsync-metal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
}

.gspsync-metal-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.gspsync-metal-tab:hover {
    color: #333;
    background: #f8f9fa;
}

.gspsync-metal-tab.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
}

.gspsync-metal-tab[data-metal="gold"].active { border-bottom-color: #f39c12; }
.gspsync-metal-tab[data-metal="silver"].active { border-bottom-color: #95a5a6; }

.gspsync-metal-panel {
    display: none;
}

.gspsync-metal-panel.active {
    display: block;
}

/* Price Info Card */
.gspsync-price-info {
    grid-column: span 2;
    grid-row: 1;
}

.gspsync-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.gspsync-price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px solid #e1e1e1;
}

.gspsync-price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.gspsync-price-value {
    font-size: 24px;
    font-weight: 700;
}

/* Metal-specific price colors */
.gspsync-price-value.gspsync-metal-gold,
.gspsync-metal-gold { color: #f39c12; }
.gspsync-price-value.gspsync-metal-silver,
.gspsync-metal-silver { color: #7f8c8d; }

.gspsync-examples {
    background: #f0f4f8;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #d5dde5;
    margin-bottom: 20px;
}

.gspsync-examples h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.gspsync-example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #d5dde5;
}

.gspsync-example-item:last-child {
    border-bottom: none;
}

.gspsync-last-update {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.gspsync-last-update .dashicons {
    margin-right: 8px;
    color: #3498db;
}

.gspsync-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    display: flex;
    align-items: center;
}

.gspsync-error .dashicons {
    margin-right: 10px;
}

/* Products List */
.gspsync-products-list {
    grid-column: span 2;
    grid-row: 3;
}

.gspsync-products-table-wrapper {
    overflow-x: auto;
}

.gspsync-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gspsync-products-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e1e1;
}

.gspsync-products-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: middle;
}

.gspsync-products-table tbody tr:hover {
    background: #f8f9fa;
}

.gspsync-product-name strong {
    color: #333;
    font-weight: 600;
}

/* Metal Status Badges */
.gspsync-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.gspsync-status-gold {
    background: #fef9e7;
    color: #9a7d0a;
    border: 1px solid #f9e79f;
}

.gspsync-status-silver {
    background: #eaecee;
    color: #566573;
    border: 1px solid #d5d8dc;
}

.gspsync-status-auto {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.gspsync-status-badge .dashicons {
    font-size: 14px;
    margin-right: 5px;
}

/* Purity Badges */
.gspsync-purity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Gold purities */
.gspsync-purity-24k { background: #f39c12; color: #fff; }
.gspsync-purity-22k { background: #e67e22; color: #fff; }
.gspsync-purity-18k { background: #d35400; color: #fff; }
.gspsync-purity-14k { background: #a0522d; color: #fff; }
.gspsync-purity-10k { background: #8b4513; color: #fff; }

/* Silver purities */
.gspsync-purity-999 { background: #95a5a6; color: #fff; }
.gspsync-purity-925 { background: #7f8c8d; color: #fff; }
.gspsync-purity-900 { background: #6c7a89; color: #fff; }
.gspsync-purity-800 { background: #5d6d7e; color: #fff; }

.gspsync-missing {
    color: #999;
    font-style: italic;
}

.gspsync-product-weight strong {
    color: #27ae60;
    font-weight: 600;
}

.gspsync-product-price strong {
    color: #2c3e50;
    font-weight: 700;
}

/* Buttons */
.gspsync-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.gspsync-btn:hover {
    background: #005a87;
    color: #fff;
}

.gspsync-btn-small {
    padding: 6px 10px;
    font-size: 11px;
}

.gspsync-btn .dashicons {
    font-size: 14px;
    margin-right: 5px;
}

.gspsync-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.gspsync-empty-state .dashicons {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Settings */
.gspsync-settings {
    grid-column: 1;
    grid-row: 2;
}

.gspsync-settings-grid {
    display: grid;
    gap: 25px;
}

.gspsync-setting-item {
    display: flex;
    flex-direction: column;
}

.gspsync-setting-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.gspsync-setting-label .dashicons {
    margin-right: 8px;
    color: #3498db;
}

.gspsync-input, .gspsync-select {
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.gspsync-input:focus, .gspsync-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.gspsync-setting-description {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.gspsync-premium-prompt {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #e67e22;
}

.gspsync-premium-prompt a {
    color: #e67e22;
    font-weight: 600;
    text-decoration: underline;
}

.gspsync-submit-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e1e1e1;
}

.gspsync-btn-primary {
    background: #3498db !important;
    border-color: #3498db !important;
    color: #fff !important;
    padding: 12px 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.gspsync-btn-primary:hover {
    background: #2980b9 !important;
    border-color: #2980b9 !important;
    transform: translateY(-1px);
}

.gspsync-btn-secondary {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    padding: 12px 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.gspsync-btn-secondary:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
    transform: translateY(-1px);
}

/* Manual Update */
.gspsync-manual-update {
    grid-column: 2;
    grid-row: 2;
}

/* Notices */
.gspsync-notice {
    border-left: 4px solid #3498db !important;
    background: #eaf2f8 !important;
    color: #2c3e50 !important;
}

/* Refresh Button */
.gspsync-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.gspsync-refresh-btn:hover {
    background: #2980b9;
    color: #fff;
    transform: rotate(180deg);
}

.gspsync-refresh-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    display: block;
}

/* Warning */
.gspsync-warning {
    color: #d63638;
    font-weight: 500;
    margin-left: 10px;
}

/* Purity Factors */
.gspsync-purity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.gspsync-purity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.gspsync-purity-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.gspsync-purity-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.gspsync-purity-input {
    width: 80px;
    text-align: center;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 5px;
}

.gspsync-purity-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.gspsync-purity-input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.gspsync-percentage {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Purity Factors Section */
.gspsync-purity-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e1e1e1;
}

.gspsync-purity-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.gspsync-purity-section h3 .dashicons {
    margin-right: 10px;
    color: #3498db;
}

/* Responsive */
@media (max-width: 1024px) {
    .gspsync-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .gspsync-price-info,
    .gspsync-products-list,
    .gspsync-settings,
    .gspsync-manual-update {
        grid-column: span 1;
        grid-row: auto;
    }

    .gspsync-price-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .gspsync-header {
        padding: 20px;
    }

    .gspsync-header h1 {
        font-size: 24px;
    }

    .gspsync-card-content {
        padding: 20px;
    }

    .gspsync-products-table {
        font-size: 12px;
    }

    .gspsync-products-table th,
    .gspsync-products-table td {
        padding: 10px 8px;
    }

    .gspsync-metal-tabs {
        flex-wrap: wrap;
    }
}

/* Live Price Preview */
.gspsync-live-price-preview {
    transition: all 0.3s ease;
}

.gspsync-live-price-preview .gspsync-price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gspsync-live-price-preview .gspsync-calculated-price {
    font-size: 1.15em;
    font-weight: 700;
    color: #2e7d32;
}

.gspsync-live-price-preview .gspsync-price-breakdown {
    margin-top: 6px;
    font-size: 0.85em;
    color: #666;
    padding-top: 6px;
    border-top: 1px dashed #ccc;
}

.gspsync-live-price-preview .gspsync-price-placeholder {
    color: #888;
    font-style: italic;
}

.gspsync-live-price-preview.gspsync-updating {
    opacity: 0.7;
}

.gspsync-live-price-preview .gspsync-calculated-price.gspsync-price-changed {
    animation: gspsync-price-pulse 0.5s ease;
}

@keyframes gspsync-price-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #1b5e20; }
    100% { transform: scale(1); }
}

/* Variation fields container */
.gspsync-variation-fields {
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.gspsync-variation-fields label {
    font-weight: 600;
    color: #333;
}

.gspsync-variation-fields input[type="number"],
.gspsync-variation-fields select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gspsync-variation-fields input[type="number"]:focus,
.gspsync-variation-fields select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
    outline: none;
}

.gspsync-variation-fields small {
    display: block;
    margin-top: 4px;
}

/* ===== Premium promo banner (free plan only) ===== */
.gspsync-premium-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(230, 126, 34, 0.28);
    position: relative;
    overflow: hidden;
}
.gspsync-premium-promo::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}
.gspsync-promo-content {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex: 1;
    min-width: 300px;
    position: relative;
    z-index: 1;
}
.gspsync-promo-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gspsync-promo-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #fff;
}
.gspsync-promo-text h2 {
    color: #fff;
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
}
.gspsync-promo-text p {
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 14px;
    font-size: 14px;
}
.gspsync-promo-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 24px;
}
.gspsync-promo-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}
.gspsync-promo-features .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
}
.gspsync-promo-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}
.gspsync-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #d35400;
    text-decoration: none;
    padding: 13px 26px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.gspsync-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    color: #d35400;
}
.gspsync-promo-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.gspsync-promo-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}
@media (max-width: 782px) {
    .gspsync-premium-promo { flex-direction: column; align-items: stretch; }
    .gspsync-promo-features { grid-template-columns: 1fr; }
    .gspsync-promo-cta { align-items: stretch; }
    .gspsync-promo-btn { justify-content: center; }
}

/* ===== Tools: System status ===== */
.gspsync-tools-divider {
    border: none;
    border-top: 1px solid #e1e1e1;
    margin: 22px 0 18px;
}
.gspsync-tools-subtitle {
    font-size: 14px;
    color: #2c3e50;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.gspsync-tools-subtitle .dashicons {
    color: #3498db;
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.gspsync-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.gspsync-status-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.gspsync-status-list li:last-child {
    border-bottom: none;
}
.gspsync-status-list li > span {
    color: #7f8c8d;
}
.gspsync-status-list li strong {
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.gspsync-status-ok { color: #27ae60 !important; }
.gspsync-status-off { color: #e67e22 !important; }
.gspsync-status-list .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
