/* FFP Manager Frontend Styles */

.ffp-add-product,
.ffp-edit-product,
.ffp-admin-products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ffp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.ffp-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* Product Form Styles */
.ffp-product-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-control {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.form-control.error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Image Upload Styles */
.image-upload-container,
.gallery-upload-container {
    border: 2px dashed #c3c4c7;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.image-upload-container:hover,
.gallery-upload-container:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.image-preview,
.gallery-preview {
    margin-bottom: 15px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img,
.gallery-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-placeholder {
    color: #646970;
    font-style: italic;
    font-size: 14px;
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    align-items: start;
}

.gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.remove-gallery-item {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(214, 54, 56, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-gallery-item:hover {
    background: #d63638;
    transform: scale(1.1);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 100px;
}

.button-primary {
    background: #2271b1;
    color: white;
}

.button-primary:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.button-secondary {
    background: #f6f7f7;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.button-link-delete {
    background: transparent;
    color: #d63638;
    border: 1px solid #d63638;
}

.button-link-delete:hover {
    background: #d63638;
    color: white;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Messages */
.ffp-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

.ffp-message.success {
    background: #f0f6fc;
    border: 1px solid #00a32a;
    color: #00a32a;
}

.ffp-message.error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
}

/* Admin Products Table */
.ffp-products-table {
    overflow-x: auto;
    margin-bottom: 30px;
}

.ffp-products-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ffp-products-table th {
    background: #f6f7f7;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.ffp-products-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ffp-products-table tr:hover {
    background: #f9f9f9;
}

.product-image {
    width: 80px;
}

.product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-image {
    width: 60px;
    height: 60px;
    background: #f6f7f7;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #646970;
}

.product-name {
    min-width: 200px;
}

.product-description {
    font-size: 13px;
    color: #646970;
    margin-top: 5px;
    line-height: 1.4;
}

.product-price,
.product-final-price {
    font-weight: 600;
    color: #333;
}

.discount-badge {
    background: #d63638;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.no-discount {
    color: #646970;
    font-size: 13px;
}

.savings {
    font-size: 12px;
    color: #00a32a;
    margin-top: 2px;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.button-small {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Summary Section */
.ffp-summary {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: #f6f7f7;
    border-radius: 6px;
    margin-top: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-label {
    font-size: 13px;
    color: #646970;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
}

/* Empty State */
.ffp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.ffp-empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

.ffp-empty-state a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.ffp-empty-state a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ffp-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button {
        width: 100%;
    }
    
    .ffp-products-table {
        font-size: 14px;
    }
    
    .ffp-products-table th,
    .ffp-products-table td {
        padding: 10px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .ffp-summary {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ffp-add-product,
    .ffp-edit-product,
    .ffp-admin-products {
        padding: 15px;
        margin: 10px;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.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); }
}

/* Focus States for Accessibility */
.form-control:focus,
.button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .form-actions,
    .product-actions,
    .ffp-header .button {
        display: none;
    }
    
    .ffp-add-product,
    .ffp-edit-product,
    .ffp-admin-products {
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 