/**
 * Helfi Custom WC Vendors Dashboard Styles
 * Mobile-first, clean UI/UX design
 * Version: 1.0.0 - Feb 2026
 */

/* ========================================
   Global Dashboard Container
   ======================================== */
.wcv-dashboard {
    background: #f9fafb;
    padding: 20px 16px;
}

.wcv-dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.wcv-dashboard-header {
    margin-bottom: 24px;
}

.wcv-dashboard-header h1,
.wcv-dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.wcv-dashboard-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ========================================
   Product Dashboard Specific Fixes
   ======================================== */

/* Reset unwanted default styles */
.wcv-product-table-search-before .wcv-flex,
.wcv-product-table-search-before .wcv-cols-group {
    display: block !important;
    width: 100% !important;
}

/* Ensure form takes full width */
.helfi-product-form {
    width: 100%;
    margin: 0;
}

/* Clean up nested wrappers */
.wcv-product-table-search-before {
    width: 100%;
}

.wcv_dashboard_table_header {
    width: 100%;
}

/* ========================================
   Action Button Groups (for table rows)
   ======================================== */
.wcv-action-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.wcv-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.wcv-action-link svg {
    width: 14px;
    height: 14px;
}

/* Action link variants */
.wcv-action-link.primary {
    color: #2563eb;
    background: #eff6ff;
    border-color: #dbeafe;
}

.wcv-action-link.primary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.wcv-action-link.success {
    color: #059669;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.wcv-action-link.success:hover {
    background: #a7f3d0;
    border-color: #6ee7b7;
}

.wcv-action-link.danger {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fee2e2;
}

.wcv-action-link.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.wcv-action-link.secondary {
    color: #6b7280;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.wcv-action-link.secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* ========================================
   Pagination Styling
   ======================================== */
.wcv-product-table-pagination-after {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.wcv-pagination,
.page-numbers {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.page-numbers a,
.page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
}

.page-numbers a:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.page-numbers span.current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    cursor: default;
}

.page-numbers .prev,
.page-numbers .next {
    font-weight: 600;
}

/* ========================================
   Form Elements Global Improvements
   ======================================== */
.wcv-form .control-group {
    margin-bottom: 16px;
}

.wcv-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.wcv-form input[type="text"],
.wcv-form input[type="email"],
.wcv-form input[type="number"],
.wcv-form input[type="url"],
.wcv-form input[type="password"],
.wcv-form textarea,
.wcv-form select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    transition: all 0.2s;
}

.wcv-form input[type="text"]:focus,
.wcv-form input[type="email"]:focus,
.wcv-form input[type="number"]:focus,
.wcv-form input[type="url"]:focus,
.wcv-form input[type="password"]:focus,
.wcv-form textarea:focus,
.wcv-form select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========================================
   Notices & Alerts
   ======================================== */
.wcv-notice,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
}

.wcv-notice.success,
.woocommerce-message {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.wcv-notice.error,
.woocommerce-error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.wcv-notice.info,
.woocommerce-info {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.wcv-notice.warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

/* ========================================
   Empty States
   ======================================== */
.wcv-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.wcv-empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.wcv-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.wcv-empty-state-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.wcv-empty-state-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    background: #3b82f6;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.wcv-empty-state-action:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ========================================
   Loading States
   ======================================== */
.wcv-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wcv-spin 0.6s linear infinite;
}

@keyframes wcv-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Notification Messages (Helfi Modern Style)
   ======================================== */
.wcv-store-msg,
.woocommerce-message,
.woocommerce-info,
.wcvendors-pro-dashboard .wcv-notice,
.wcvendors-pro-dashboard .updated,
.wcvendors-pro-dashboard .error,
.woocommerce-error {
    width: 100%;
    padding: 14px 18px;
    margin: 0 0 20px 0;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-left: 4px solid #0f8b00;
    border-radius: 8px;
    color: #166534;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: left;
    clear: both;
}

.wcv-store-msg::before,
.woocommerce-message::before,
.wcvendors-pro-dashboard .updated::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #0f8b00;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.woocommerce-info,
.wcvendors-pro-dashboard .wcv-notice {
    background: #eff6ff;
    border-color: #93c5fd;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.woocommerce-info::before,
.wcvendors-pro-dashboard .wcv-notice::before {
    content: "ℹ";
    background: #3b82f6;
}

.wcvendors-pro-dashboard .error,
.woocommerce-error {
    background: #fef2f2;
    border-color: #fca5a5;
    border-left-color: #dc2626;
    color: #991b1b;
}

.wcvendors-pro-dashboard .error::before,
.woocommerce-error::before {
    content: "✕";
    background: #dc2626;
}

/* Remove any button styles from messages */
.wcv-store-msg .button,
.woocommerce-message .button,
.woocommerce-info .button {
    margin-left: auto;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (min-width: 640px) {
    .wcv-dashboard {
        padding: 24px 20px;
    }
    
    .wcv-dashboard-header h1,
    .wcv-dashboard-header h2 {
        font-size: 28px;
    }
}

@media (min-width: 768px) {
    .wcv-dashboard {
        padding: 32px 24px;
    }
    
    .wcv-dashboard-header {
        margin-bottom: 32px;
    }
    
    .wcv-dashboard-header h1,
    .wcv-dashboard-header h2 {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    .wcv-dashboard {
        padding: 40px 32px;
    }
}

/* Mobile responsive for messages */
@media (max-width: 640px) {
    .wcv-store-msg,
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .wcv-store-msg::before,
    .woocommerce-message::before,
    .woocommerce-info::before,
    .woocommerce-error::before {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .helfi-quick-links,
    .helfi-filters,
    .helfi-actions,
    .wcv-action-group,
    .wcv-product-table-pagination-after {
        display: none !important;
    }
    
    .wcv-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wcv-table tbody tr:hover {
        background: transparent;
    }
}
