/* Frontend Product Manager Styles - WooCommerce-like Design */

.fpm-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fpm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.fpm-header h2 {
    margin: 0;
    color: #1d2327;
    font-size: 24px;
    font-weight: 600;
}

.fpm-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Button Styles */
.fpm-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.fpm-btn-primary {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.fpm-btn-primary:hover {
    background-color: #135e96;
    border-color: #135e96;
    color: #fff;
}

.fpm-btn-secondary {
    background-color: #f6f7f7;
    color: #1d2327;
    border-color: #dcdcde;
}

.fpm-btn-secondary:hover {
    background-color: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}

.fpm-btn-danger {
    background-color: #d63638;
    color: #fff;
    border-color: #d63638;
}

.fpm-btn-danger:hover {
    background-color: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

.fpm-btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Table Styles */
.fpm-table-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.fpm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
}

.fpm-table thead {
    background-color: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
}

.fpm-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    border-right: 1px solid #c3c4c7;
    position: relative;
}

.fpm-table th:last-child {
    border-right: none;
}

.fpm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
    border-right: 1px solid #f0f0f1;
    vertical-align: middle;
}

.fpm-table td:last-child {
    border-right: none;
}

.fpm-table tbody tr:hover {
    background-color: #f6f7f7;
}

.fpm-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #e8e8e9;
}

.sort-indicator {
    margin-left: 8px;
    font-size: 12px;
    color: #8c8f94;
}

.sort-indicator.active {
    color: #2271b1;
}

.sort-indicator.asc::after {
    content: " ↑";
}

.sort-indicator.desc::after {
    content: " ↓";
}

/* Product Name Links */
.product-name-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.product-name-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Actions Column */
.actions {
    white-space: nowrap;
}

.actions .fpm-btn {
    margin-right: 8px;
}

.actions .fpm-btn:last-child {
    margin-right: 0;
}

/* Modal Styles */
.fpm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.fpm-modal.show {
    display: block !important;
}

.fpm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.fpm-modal-large {
    max-width: 1000px;
    max-height: 90vh;
}

.fpm-modal-wide {
    max-width: 1200px;
    max-height: 90vh;
}

.fpm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #c3c4c7;
    background-color: #f6f7f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fpm-modal-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
}

.fpm-modal-close {
    color: #8c8f94;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.fpm-modal-close:hover {
    color: #1d2327;
}

.fpm-modal-body {
    padding: 32px;
}

/* Form Styles */
.fpm-form-group {
    margin-bottom: 20px;
}

.fpm-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.fpm-form-row .fpm-form-group {
    flex: 1;
    margin-bottom: 0;
}

.fpm-form-group.half-width {
    width: 50%;
    max-width: 400px;
}

.fpm-form-group.two-thirds-width {
    width: 66.67%;
    max-width: 600px;
}

.fpm-form-row.spaced {
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.fpm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.fpm-form-group input,
.fpm-form-group textarea,
.fpm-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.fpm-form-group input:focus,
.fpm-form-group textarea:focus,
.fpm-form-group select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.fpm-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.fpm-form-group small {
    display: block;
    margin-top: 4px;
    color: #8c8f94;
    font-size: 12px;
}

.fpm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

/* Image Preview */
.image-preview {
    margin-top: 8px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 4px;
    background-color: #f6f7f7;
}

/* File Upload Styles */
.file-upload-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.file-upload-item .downloadable-file {
    flex: 1;
    margin: 0;
}

.file-upload-item .file-name {
    flex: 1;
    margin: 0;
}

.file-upload-item .remove-file {
    flex-shrink: 0;
}

/* Warning Modal Styles */
.fpm-warning-icon {
    text-align: center;
    margin-bottom: 20px;
}

.fpm-warning-icon .dashicons {
    font-size: 48px;
    color: #d63638;
}

.fpm-warning-text {
    color: #8c8f94;
    font-style: italic;
    margin-top: 12px;
}

/* Success Modal */
.fpm-success-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 20px;
}

.fpm-success-icon .dashicons {
    color: #00a32a;
    font-size: 48px;
    width: 48px;
    height: 48px;
}

#success-message {
    text-align: center;
    font-size: 16px;
    color: #1d2327;
    margin-bottom: 20px;
}

/* Product Details Modal */
#product-details-content {
    line-height: 1.6;
}

.product-detail-image-top {
    text-align: center;
    margin-bottom: 24px;
}

.product-detail-image-top img {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 8px;
    background-color: #f6f7f7;
}

.product-details-grid {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.product-details-left,
.product-details-right {
    flex: 1;
}

.product-detail-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f1;
}

.product-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.product-detail-description {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e1e1e1;
}

.product-detail-label {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.product-detail-value {
    color: #3c434a;
}

.product-detail-image {
    text-align: center;
    margin-top: 16px;
}

.product-detail-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 8px;
    background-color: #f6f7f7;
}

/* Filters */
.fpm-filters {
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.fpm-filter-form {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.fpm-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.fpm-filter-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
    font-size: 14px;
}

.fpm-filter-group select,
.fpm-filter-group input {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.fpm-filter-group .fpm-btn {
    text-align: center;
    padding: 8px 16px;
    margin-top: 20px;
}

.fpm-filter-buttons {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-direction: row;
}

.fpm-filter-buttons .fpm-btn {
    margin-top: 20px;
    flex: none;
}

/* Bulk Actions */
.fpm-bulk-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.fpm-bulk-actions select {
    padding: 6px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

.fpm-bulk-actions .fpm-btn {
    padding: 6px 12px;
    height: auto;
}

.fpm-bulk-actions .fpm-btn-primary {
    background-color: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
}

/* Pagination */
.fpm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
}

.fpm-pagination .fpm-btn {
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
}

.fpm-pagination .current {
    background-color: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}

/* Checkbox column */
.fpm-table th:first-child,
.fpm-table td:first-child {
    width: 40px;
    text-align: center;
}

/* Orders table column widths */
#orders-table th:nth-child(1),
#orders-table td:nth-child(1) {
    width: 20%; /* Order # column - increased */
}

#orders-table th:nth-child(2),
#orders-table td:nth-child(2) {
    width: 15%; /* Date column - reduced */
}

#orders-table th:nth-child(3),
#orders-table td:nth-child(3) {
    width: 15%; /* Status column */
}

#orders-table th:nth-child(4),
#orders-table td:nth-child(4) {
    width: 20%; /* Customer column */
}

#orders-table th:nth-child(5),
#orders-table td:nth-child(5) {
    width: 15%; /* Total column */
}

#orders-table th:nth-child(6),
#orders-table td:nth-child(6) {
    width: 15%; /* Actions column */
}

/* Tabs */
.fpm-tabs {
    display: flex;
    border-bottom: 1px solid #c3c4c7;
    margin-bottom: 20px;
}

.fpm-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #8c8f94;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.fpm-tab-btn:hover {
    color: #1d2327;
    background-color: #f6f7f7;
}

.fpm-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    background-color: #fff;
}

.fpm-tab-content {
    position: relative;
}

.fpm-tab-panel {
    display: none;
}

.fpm-tab-panel.active {
    display: block;
}

/* Order Status */
.order-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Order status dropdown */
.order-status-dropdown {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    min-width: 120px;
}

.order-status-dropdown:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Clickable status labels */
.clickable-status {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.clickable-status:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.order-status-pending {
    background-color: #f0ad4e;
    color: #fff;
}

.order-status-processing {
    background-color: #5bc0de;
    color: #fff;
}

.order-status-on-hold {
    background-color: #f0ad4e;
    color: #fff;
}

.order-status-completed {
    background-color: #5cb85c;
    color: #fff;
}

.order-status-cancelled {
    background-color: #d9534f;
    color: #fff;
}

.order-status-refunded {
    background-color: #777;
    color: #fff;
}

.order-status-failed {
    background-color: #d9534f;
    color: #fff;
}

/* Order Items Section */
.order-items-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #c3c4c7;
}

.order-items-section h3 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 18px;
}

.order-items-section .fpm-table {
    margin-top: 0;
}

/* Login Form */
.fpm-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.fpm-login-form {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px 50px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.fpm-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.fpm-login-header h2 {
    color: #1d2327;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.fpm-login-header p {
    color: #8c8f94;
    margin: 0;
    font-size: 14px;
}

.fpm-login-form .fpm-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.fpm-login-form .fpm-form-actions {
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.fpm-login-form .fpm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
}

.fpm-login-form input[type="text"],
.fpm-login-form input[type="password"] {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.fpm-login-form input[type="text"]:focus,
.fpm-login-form input[type="password"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.fpm-checkbox-label {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.fpm-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.fpm-btn-full {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
}

.fpm-login-links {
    text-align: center;
    margin-top: 20px;
}

.fpm-login-links a {
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.fpm-login-links a:hover {
    text-decoration: underline;
}

/* Access Denied Message */
.fpm-access-denied {
    text-align: center;
    padding: 40px 20px;
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    color: #d63638;
    margin: 20px 0;
}

.fpm-access-denied p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* No Products Message */
.fpm-no-products {
    text-align: center;
    padding: 40px 20px;
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    color: #8c8f94;
}

/* Bulk Actions */
.fpm-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.fpm-bulk-actions select {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.fpm-bulk-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .fpm-dashboard {
        padding: 10px;
    }
    
    .fpm-login-container {
        padding: 10px;
    }
    
    .fpm-login-form {
        padding: 30px 40px;
        margin: 0 10px;
    }
    
    .fpm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .fpm-table-container {
        overflow-x: auto;
    }
    
    .fpm-table {
        min-width: 600px;
    }
    
    .fpm-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .fpm-form-actions {
        flex-direction: column;
    }
    
    .fpm-form-actions .fpm-btn {
        width: 100%;
    }
}

/* Loading States */
.fpm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.fpm-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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