/* ==========================================================================
   Petwebly Pet Store Integration — Public Styles
   Compatible with TownHub theme and Petwebly Dashboard v8
   ========================================================================== */

/* ── Dashboard Wrapper ──────────────────────────────────────────────────── */
.ppsi-dashboard-wrap {
    width: 100%;
}

/* ── Store Profile Card ─────────────────────────────────────────────────── */
.ppsi-store-card .ppsi-store-profile {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 16px 0;
}

.ppsi-store-logo {
    flex-shrink: 0;
}

.ppsi-store-logo img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e8e8e8;
}

.ppsi-store-info {
    flex: 1;
}

.ppsi-store-info h4 {
    margin: 0 0 6px;
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
}

.ppsi-store-meta {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.ppsi-store-meta li {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 4px;
}

.ppsi-store-meta li i {
    width: 16px;
    color: #f7a800;
    margin-right: 6px;
}

.ppsi-store-meta a {
    color: #f7a800;
    text-decoration: none;
}

.ppsi-store-meta a:hover {
    text-decoration: underline;
}

/* ── Status Badges ──────────────────────────────────────────────────────── */
.ppsi-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ppsi-status-publish  { background: #d4edda; color: #155724; }
.ppsi-status-pending  { background: #fff3cd; color: #856404; }
.ppsi-status-draft    { background: #e2e3e5; color: #383d41; }

/* ── Action Buttons ─────────────────────────────────────────────────────── */
.ppsi-store-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ppsi-btn-sm {
    padding: 5px 14px;
    font-size: 0.85em;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ppsi-btn-sm:hover { opacity: 0.85; }

.ppsi-btn-view    { background: #17a2b8; color: #fff; }
.ppsi-btn-edit    { background: #f7a800; color: #fff; }
.ppsi-btn-add     { background: #28a745; color: #fff; }
.ppsi-btn-primary { background: #f7a800; color: #fff; padding: 10px 24px; border-radius: 4px; text-decoration: none; display: inline-block; font-weight: 600; }
.ppsi-btn-primary:hover { background: #e09600; color: #fff; }

/* ── Products Table ─────────────────────────────────────────────────────── */
.ppsi-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-top: 8px;
}

.ppsi-products-table th,
.ppsi-products-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ppsi-products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ppsi-products-table tr:hover td {
    background: #fafafa;
}

.ppsi-product-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ppsi-product-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.ppsi-product-name a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.ppsi-product-name a:hover { color: #f7a800; }

.ppsi-product-actions {
    display: flex;
    gap: 8px;
}

.ppsi-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background 0.2s;
}

.ppsi-action-edit   { background: #fff3cd; color: #856404; }
.ppsi-action-view   { background: #d1ecf1; color: #0c5460; }
.ppsi-action-delete { background: #f8d7da; color: #721c24; }

.ppsi-action-edit:hover   { background: #ffc107; color: #fff; }
.ppsi-action-view:hover   { background: #17a2b8; color: #fff; }
.ppsi-action-delete:hover { background: #dc3545; color: #fff; }

/* ── Statistics Grid ────────────────────────────────────────────────────── */
.ppsi-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.ppsi-stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.ppsi-stat-number {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 6px;
}

.ppsi-stat-label {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ppsi-stat-published .ppsi-stat-number { color: #28a745; }
.ppsi-stat-pending   .ppsi-stat-number { color: #ffc107; }

/* ── Empty State ────────────────────────────────────────────────────────── */
.ppsi-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.ppsi-empty-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 12px;
    color: #dee2e6;
}

.ppsi-empty-state h4 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #495057;
}

.ppsi-empty-state p {
    font-size: 0.95em;
    margin-bottom: 20px;
}

/* ── Notice ─────────────────────────────────────────────────────────────── */
.ppsi-notice {
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 0.95em;
}

/* ── Dashboard Box Title Override ───────────────────────────────────────── */
.ppsi-dashboard-wrap .dashboard-list-box-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ppsi-store-card .ppsi-store-profile {
        flex-direction: column;
    }

    .ppsi-products-table thead {
        display: none;
    }

    .ppsi-products-table tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 8px;
    }

    .ppsi-products-table td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #f5f5f5;
        padding: 6px 8px;
    }

    .ppsi-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ── Frontend Forms ─────────────────────────────────────────────────────── */
.ppsi-form-wrap {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin: 20px 0;
}

.ppsi-form-wrap h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.3em;
    color: #2c3e50;
}

.ppsi-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ppsi-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ppsi-form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.ppsi-form-group .required {
    color: #dc3545;
}

.ppsi-form-control {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ppsi-form-control:focus {
    outline: none;
    border-color: #f7a800;
    box-shadow: 0 0 0 3px rgba(247, 168, 0, 0.1);
}

.ppsi-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ppsi-form-col-6 {
    grid-column: span 1;
}

@media (max-width: 600px) {
    .ppsi-form-row {
        grid-template-columns: 1fr;
    }
}

.ppsi-form-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 0.95em;
}

.ppsi-form-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.ppsi-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.ppsi-dashboard-form-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}
