/* Frontend Product Pro - Frontend Styles */

/* Reset and Base Styles */
.fpp-form-container,
.fpp-listing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Form Styles */
.fpp-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.fpp-form h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
}

.fpp-form-group {
    margin-bottom: 25px;
}

.fpp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
}

.fpp-form-group input[type="text"],
.fpp-form-group input[type="number"],
.fpp-form-group input[type="file"],
.fpp-form-group select,
.fpp-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

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

.fpp-form-group input.fpp-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.fpp-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Submit Button */
.fpp-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fpp-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

.fpp-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Image Preview */
.fpp-image-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 200px;
}

.fpp-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Message Styles */
.fpp-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.fpp-message.fpp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fpp-message.fpp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Product Listing Styles */
.fpp-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.fpp-listing-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 32px;
    font-weight: 600;
}

.fpp-add-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.fpp-add-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
    color: white;
    text-decoration: none;
}

/* Products Grid */
.fpp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.fpp-product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
}

.fpp-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.fpp-product-image {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fpp-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fpp-product-card:hover .fpp-product-image img {
    transform: scale(1.05);
}

.fpp-no-image {
    color: #95a5a6;
    font-size: 14px;
    text-align: center;
}

.fpp-product-info {
    padding: 20px;
}

.fpp-product-title {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.fpp-product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.fpp-price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
}

.fpp-regular-price {
    font-size: 16px;
    color: #95a5a6;
    text-decoration: line-through;
}

.fpp-sale-price {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
}

.fpp-product-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
}

.fpp-edit-btn,
.fpp-delete-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.fpp-edit-btn {
    background: #3498db;
    color: white;
}

.fpp-edit-btn:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
}

.fpp-delete-btn {
    background: #e74c3c;
    color: white;
}

.fpp-delete-btn:hover {
    background: #c0392b;
}

/* Delete button loading states */
.fpp-delete-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.fpp-product-card.fpp-deleting {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.fpp-product-card.fpp-deleting::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    z-index: 1;
}

.fpp-product-card.fpp-deleted {
    opacity: 0.5;
    background: #f8f9fa;
}

.fpp-product-card.fpp-deleted .fpp-delete-btn {
    background: #27ae60;
    color: white;
}

/* Loading States */
.fpp-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

.fpp-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.fpp-no-products {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Product Selector */
.fpp-product-selector {
    text-align: center;
    padding: 40px;
}

.fpp-product-selector h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.fpp-product-selector select {
    max-width: 400px;
    margin: 0 auto;
}

/* Toast Notifications */
.fpp-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.fpp-toast.fpp-toast-show {
    transform: translateX(0);
}

.fpp-toast-success {
    background: #27ae60;
}

.fpp-toast-error {
    background: #e74c3c;
}

/* Multi-Step Form Styles */
.fpp-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.fpp-progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e1e5e9;
    z-index: 1;
}

.fpp-progress-step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.fpp-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e1e5e9;
    color: #888;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.fpp-progress-step.active .fpp-step-number {
    background: #3498db;
    border-color: #3498db;
    color: #fff;
}

.fpp-progress-step.completed .fpp-step-number {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.fpp-step-title {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 500;
    transition: color 0.3s ease;
}

.fpp-progress-step.active .fpp-step-title {
    color: #3498db;
    font-weight: 600;
}

.fpp-progress-step.completed .fpp-step-title {
    color: #27ae60;
    font-weight: 600;
}

.fpp-form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.fpp-form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fpp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fpp-step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.fpp-prev-btn, .fpp-next-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fpp-prev-btn {
    background: #f8f9fa;
    color: #6c757d;
}

.fpp-prev-btn:hover {
    background: #e9ecef;
}

.fpp-next-btn {
    background: #3498db;
    color: #fff;
}

.fpp-next-btn:hover {
    background: #2980b9;
}

/* Select2 Customization */
.fpp-select2 {
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    margin: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 5px;
}

/* Attributes Container */
.fpp-attribute-group {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #f8f9fa;
}

.fpp-attribute-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.fpp-attribute-select {
    width: 100%;
}

/* Gallery Preview */
.fpp-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.fpp-gallery-item {
    position: relative;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
}

.fpp-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fpp-gallery-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overview Section */
.fpp-overview-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.fpp-overview-section {
    margin-bottom: 25px;
}

.fpp-overview-section:last-child {
    margin-bottom: 0;
}

.fpp-overview-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.fpp-overview-item {
    display: flex;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.fpp-overview-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.fpp-overview-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 120px;
    margin-right: 15px;
}

.fpp-overview-value {
    flex: 1;
    color: #2c3e50;
}

.fpp-overview-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fpp-overview-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.fpp-overview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fpp-overview-image.main {
    border: 2px solid #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fpp-form-container,
    .fpp-listing-container {
        padding: 15px;
    }
    
    .fpp-form {
        padding: 20px;
    }
    
    .fpp-listing-header {
        flex-direction: column;
        text-align: center;
    }
    
    .fpp-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fpp-product-actions {
        flex-direction: column;
    }
    
    .fpp-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .fpp-progress-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .fpp-progress-bar::before {
        display: none;
    }
    
    .fpp-form-row {
        grid-template-columns: 1fr;
    }
    
    .fpp-step-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .fpp-prev-btn, .fpp-next-btn {
        width: 100%;
    }
    
    .fpp-gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .fpp-form h2 {
        font-size: 24px;
    }
    
    .fpp-listing-header h2 {
        font-size: 28px;
    }
    
    .fpp-product-info {
        padding: 15px;
    }
    
    .fpp-product-actions {
        padding: 0 15px 15px;
    }
}

/* Accessibility Improvements */
.fpp-form-group.fpp-focused {
    position: relative;
}

.fpp-form-group.fpp-focused::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #3498db;
    border-radius: 8px;
    pointer-events: none;
}

/* Focus styles for keyboard navigation */
.fpp-submit-btn:focus,
.fpp-edit-btn:focus,
.fpp-delete-btn:focus,
.fpp-add-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fpp-form {
        border: 2px solid #000;
    }
    
    .fpp-product-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fpp-product-card,
    .fpp-submit-btn,
    .fpp-add-btn,
    .fpp-edit-btn,
    .fpp-delete-btn,
    .fpp-product-image img {
        transition: none;
    }
    
    .fpp-product-card:hover {
        transform: none;
    }
    
    .fpp-submit-btn:hover,
    .fpp-add-btn:hover {
        transform: none;
    }
} 

/* Cropper Modal Styles */
.fpp-cropper-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.fpp-cropper-modal-overlay[style*="display: block"],
.fpp-cropper-modal-overlay[style*="display: flex"] {
    display: flex !important;
}
.fpp-cropper-modal {
    background: #fff;
    padding: 32px 24px 24px 24px;
    border-radius: 14px;
    max-width: 420px;
    width: 95vw;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.fpp-cropper-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
}
.fpp-cropper-close:hover {
    color: #e74c3c;
}
.fpp-cropper-title {
    margin: 0 0 18px 0;
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}
.fpp-cropper-img-wrap {
    width: 320px;
    max-width: 80vw;
    max-height: 50vh;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}
.fpp-cropper-img {
    max-width: 100%;
    max-height: 50vh;
    display: block;
}
.fpp-cropper-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}
.fpp-cropper-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.fpp-cropper-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
}

@media (max-width: 600px) {
    .fpp-cropper-modal {
        max-width: 98vw;
        padding: 16px 4vw 16px 4vw;
    }
    .fpp-cropper-img-wrap {
        width: 90vw;
        max-width: 90vw;
    }
} 